libft/src/ft_strchr.c

29 lines
1.1 KiB
C
Raw Normal View History

2023-04-15 06:46:13 +02:00
/* ************************************************************************** */
/* */
2023-10-26 18:06:04 +02:00
/* :::::::: */
/* ft_strchr.c :+: :+: */
/* +:+ */
/* By: djonker <djonker@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2022/11/22 13:34:05 by djonker #+# #+# */
/* Updated: 2023/10/18 17:00:15 by houtworm ######## odam.nl */
2023-04-15 06:46:13 +02:00
/* */
/* ************************************************************************** */
#include "../libft.h"
char *ft_strchr(const char *s, int c)
{
if (!s)
return (0);
while (*s)
{
if (c == *s)
return ((char *)s);
s++;
}
if (c == *s)
return ((char *)s);
return (0);
}