style: reoarginsed the file and fix the makefile
This commit is contained in:
parent
ecd9608320
commit
a5fe7484a1
46 changed files with 140 additions and 49 deletions
31
ft_memcmp.c
31
ft_memcmp.c
|
|
@ -1,31 +0,0 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_memcmp.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/07 16:49:04 by rparodi #+# #+# */
|
||||
/* Updated: 2023/11/07 18:46:15 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
int ft_memcmp(const void *s1, const void *s2, size_t n)
|
||||
{
|
||||
size_t i;
|
||||
unsigned char *str1;
|
||||
unsigned char *str2;
|
||||
|
||||
i = 0;
|
||||
str1 = (unsigned char *)s1;
|
||||
str2 = (unsigned char *)s2;
|
||||
while (i < n)
|
||||
{
|
||||
if (str1[i] != str2[i])
|
||||
return (str1[i] - str2[i]);
|
||||
i++;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue