24 lines
1.1 KiB
C
24 lines
1.1 KiB
C
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* ::: :::::::: */
|
||
|
/* ft_strchr.c :+: :+: :+: */
|
||
|
/* +:+ +:+ +:+ */
|
||
|
/* By: gbrochar <marvin@42.fr> +#+ +:+ +#+ */
|
||
|
/* +#+#+#+#+#+ +#+ */
|
||
|
/* Created: 2015/11/27 09:50:37 by gbrochar #+# #+# */
|
||
|
/* Updated: 2015/11/27 10:23:06 by gbrochar ### ########.fr */
|
||
|
/* */
|
||
|
/* ************************************************************************** */
|
||
|
|
||
|
#include "libft.h"
|
||
|
|
||
|
char *ft_strchr(const char *s, int c)
|
||
|
{
|
||
|
while (*s != '\0')
|
||
|
if (*s++ == (char)c)
|
||
|
return ((char *)--s);
|
||
|
if ((char)c == '\0')
|
||
|
return ((char *)s);
|
||
|
return (NULL);
|
||
|
}
|