fractol/libft/src/ft_strchr.c

27 lines
1.0 KiB
C
Raw Normal View History

2023-03-01 04:36:42 +01:00
/* ************************************************************************** */
/* */
/* .--. _ */
/* ft_strchr.c :+: :+: :+: */
/* |:_/ || |_ _ ___ __ */
/* By: djonker <djonker@student.codam.nl> // \ \ __| | | \ \/ / */
/* (| | )|_| |_| |> < */
/* Created: 2022/11/22 13:34:05 by djonker /'\_ _/`\__|\__,_/_/\_\ */
/* Updated: 2023/02/07 00:40:50 by houtworm ### ########.fr */
/* */
/* ************************************************************************** */
#include "../libft.h"
char *ft_strchr(const char *s, int c)
{
while (*s)
{
if (c == *s)
return ((char *)s);
s++;
}
if (c == *s)
return ((char *)s);
return (0);
}