ft_strchr.c 1.1 KB

1234567891011121314151617181920212223242526
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* ft_strchr.c :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: mazimi <mazimi@student.42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2014/11/21 16:01:42 by mazimi #+# #+# */
  9. /* Updated: 2014/12/02 15:59:57 by mazimi ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "../libft.h"
  13. char *ft_strchr(const char *s1, int c)
  14. {
  15. int i;
  16. i = -1;
  17. while (s1[++i])
  18. if (s1[i] == c)
  19. return ((char *)&(s1[i]));
  20. if (s1[i] == c)
  21. return ((char *)&(s1[i]));
  22. return (NULL);
  23. }