/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strichr.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: bchanot +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2015/12/03 11:37:13 by bchanot #+# #+# */ /* Updated: 2018/10/29 11:58:15 by bchanot ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" size_t ft_strichr(const char *const s, int c) { size_t i; i = 0; if (!s || !c) return (false); while (s[i]) { if (s[i] == (char)c) return (i); i++; } if (s[i] == (char)c) return (i); return (-1); }