lem_in/Oglibft/libft/srcs/ft_strchr.c
Mthandazo Ndhlovu 1abb3fc566 invalid maps
2019-04-02 15:09:43 +02:00

30 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/04/04 18:54:17 by tmaze #+# #+# */
/* Updated: 2018/05/16 15:09:08 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *s, int c)
{
int i;
char *tmp;
if (s != NULL)
{
i = -1;
tmp = (char*)s;
while (++i == 0 || tmp[i - 1])
if (tmp[i] == c)
return (&tmp[i]);
}
return (NULL);
}