/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_memchr.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: gtertysh +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/29 15:55:30 by gtertysh #+# #+# */ /* Updated: 2016/11/30 18:51:40 by gtertysh ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" void *ft_memchr(const void *s, int c, size_t n) { while (n--) { if (*(unsigned char *)s == (unsigned char)c) return ((unsigned char *)s); s++; } return (NULL); }