| 12345678910111213141516171819202122232425262728293031 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_strichr.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* 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);
- }
|