42_minishell/utils/ft_strnchr.c

16 lines
173 B
C

#include "utils.h"
ssize_t ft_strnchr(const char *str, char c)
{
size_t i;
i = 0;
while (str[i] != '\0')
{
if (str[i] == c)
return (i);
i++;
}
return (-1);
}