diff options
Diffstat (limited to 'libft/ft_strchr.c')
-rw-r--r-- | libft/ft_strchr.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libft/ft_strchr.c b/libft/ft_strchr.c new file mode 100644 index 0000000..373c5bb --- /dev/null +++ b/libft/ft_strchr.c @@ -0,0 +1,24 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strchr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: kdx <kdx @student.42angouleme.fr +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2022/09/27 23:37:56 by kdx #+# #+# */ +/* Updated: 2022/10/14 02:25:14 by kdx ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +char *ft_strchr(const char *s, int c) +{ + while (*s != c) + { + if (*s == '\0') + return (NULL); + s += 1; + } + return ((char *)s); +} |