From 462e664d0fdfbe2e9eae5c7e093c5a23b202dae8 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 29 Sep 2020 19:11:10 +0200 Subject: Norm update --- libft/src/ft_memccpy.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'libft/src/ft_memccpy.c') diff --git a/libft/src/ft_memccpy.c b/libft/src/ft_memccpy.c index 70f8226..6f62231 100644 --- a/libft/src/ft_memccpy.c +++ b/libft/src/ft_memccpy.c @@ -11,21 +11,19 @@ /* ************************************************************************** */ #include -#include -void - *ft_memccpy(void *dst, const void *src, int c, size_t n) +void *ft_memccpy(void *dst, const void *src, int c, size_t n) { unsigned char *dst_ptr; const unsigned char *src_ptr; dst_ptr = (unsigned char*)dst; src_ptr = (unsigned char*)src; - if (!*dst_ptr && !*src_ptr && n) + if (*dst_ptr == '\0' && *src_ptr == '\0' && n != 0) return (NULL); - if (n) + if (n != 0) { - while (n) + while (n != 0) { if ((*dst_ptr++ = *src_ptr++) == (unsigned char)c) return (dst_ptr); -- cgit v1.2.3