libft/ft_strchr.c
2020-12-11 18:42:06 +01:00

27 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/11/29 00:12:32 by apommier #+# #+# */
/* Updated: 2020/12/11 18:23:01 by apommier ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *s, int c)
{
unsigned char *str;
str = (unsigned char*)s;
while ((*str != c) || (*str != 0))
str++;
if (*str == c)
return (str);
else
return (0);
}