Push_swap/libft/ft_strchr.c
2022-01-17 16:20:46 +01:00

27 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/12 13:57:59 by apommier #+# #+# */
/* Updated: 2022/01/17 11:34:28 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 ((char *)str);
else
return (0);
}