31 lines
1.1 KiB
C
31 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strchr.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2016/11/03 14:57:53 by jhalford #+# #+# */
|
|
/* Updated: 2017/02/20 16:43:10 by jhalford ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
char *ft_strchr(const char *s, int c)
|
|
{
|
|
char *a;
|
|
|
|
if (!s)
|
|
return (NULL);
|
|
a = (char *)s;
|
|
while (*a)
|
|
{
|
|
if (*a == (char)c)
|
|
return (a);
|
|
a++;
|
|
}
|
|
if (*a == (char)c)
|
|
return (a);
|
|
return (NULL);
|
|
}
|