/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_memchr.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: tosuman +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/05/22 16:34:06 by tosuman #+# #+# */ /* Updated: 2023/05/22 16:34:06 by tosuman ### ########.fr */ /* */ /* ************************************************************************** */ #include void *ft_memchr(const void *s, int c, size_t n) { unsigned char *us; us = (unsigned char *) s; while (n--) if (*us++ == (unsigned char) c) return (--us); return (0); }