/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_memchr.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/02/10 13:42:10 by fgras-ca #+# #+# */ /* Updated: 2023/02/14 13:03:28 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" void *ft_memchr(const void *s, int c, size_t n) { size_t i; i = 0; while (i < n) { if (((unsigned char *)s)[i] == (unsigned char)c) return ((void *)(s + i)); i++; } return (0); }