30 lines
1.1 KiB
C
30 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strchr.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: vvobis <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2024/04/03 12:20:50 by vvobis #+# #+# */
|
|
/* Updated: 2024/04/09 20:54:14 by vvobis ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
char *ft_strchr(char const *s, int c)
|
|
{
|
|
int i;
|
|
|
|
i = 0;
|
|
while (s[i])
|
|
{
|
|
if (s[i] == (char)c)
|
|
return ((char *)&s[i]);
|
|
i++;
|
|
}
|
|
if ((char)c == 0)
|
|
return ((char *)&s[i]);
|
|
return (NULL);
|
|
}
|