42_ft_printf/ft_strchr.c
Camille Chauvet 780ac9ced3 init
2022-10-07 02:30:03 +02:00

25 lines
1.0 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/26 14:44:15 by cchauvet #+# #+# */
/* Updated: 2022/10/05 20:56:37 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
char *ft_strchr(const char *s, int c)
{
while (*s != (char) c)
{
if (*s == 0)
return (NULL);
s++;
}
return ((char *) s);
}