/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* pf_strchr.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: tmaze +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/02/11 07:42:57 by tmaze #+# #+# */ /* Updated: 2019/02/11 07:43:10 by tmaze ### ########.fr */ /* */ /* ************************************************************************** */ #include "libftprintf.h" char *pf_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); }