From 10b4feb67c8af2b099dabd66f948b02e180bae0d Mon Sep 17 00:00:00 2001 From: Cabergs Charles Date: Mon, 7 Oct 2019 11:35:51 +0200 Subject: Normed everything Created a few dummy functions to resolve functions having more than 25 lines. --- ft_memcmp.c | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) (limited to 'ft_memcmp.c') diff --git a/ft_memcmp.c b/ft_memcmp.c index 76cd47d..32a2cc4 100644 --- a/ft_memcmp.c +++ b/ft_memcmp.c @@ -1,19 +1,31 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_memcmp.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/10/07 09:56:44 by cacharle #+# #+# */ +/* Updated: 2019/10/07 09:59:58 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include -int ft_memcmp(const void *s1, const void *s2, size_t n) +int ft_memcmp(const void *s1, const void *s2, size_t n) { - size_t i; - unsigned char *uc_s1; - unsigned char *uc_s2; + size_t i; + unsigned char *uc_s1; + unsigned char *uc_s2; - uc_s1 = (unsigned char*)s1; - uc_s2 = (unsigned char*)s2; - i = 0; - if (n == 0) - return (0); - while (i < n && uc_s1[i] == uc_s2[i]) - i++; - if (i == n) - i--; - return (uc_s1[i] - uc_s2[i]); + uc_s1 = (unsigned char*)s1; + uc_s2 = (unsigned char*)s2; + i = 0; + if (n == 0) + return (0); + while (i < n && uc_s1[i] == uc_s2[i]) + i++; + if (i == n) + i--; + return (uc_s1[i] - uc_s2[i]); } -- cgit