pipex/libft/ft_strchr.c
Etienne Rey-bethbeder 5f970ff3d8 0.1
2023-01-11 17:36:09 +01:00

30 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/27 10:05:58 by erey-bet #+# #+# */
/* Updated: 2022/10/11 02:22:26 by erey-bet ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *str, int search)
{
int i;
i = 0;
while (str[i] || str[i] == (unsigned char)search)
{
if (str[i] == (unsigned char)search)
{
return ((char *)&str[i]);
}
i++;
}
return (NULL);
}