/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_memchr.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: grobledo +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/02/08 20:08:44 by grobledo #+# #+# */ /* Updated: 2023/02/08 20:08:45 by grobledo ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" void *ft_memchr(const void *str, int c, size_t n) { size_t i; i = 0; while (i < n) { if ((((unsigned char *)str)[i]) == (unsigned char)c) return ((void *)str + i); i++; } return (NULL); }