-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_memcmp.c
More file actions
29 lines (27 loc) · 1.12 KB
/
Copy pathft_memcmp.c
File metadata and controls
29 lines (27 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: danrodr3 <danrodr3@students.42madrid.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/10/10 13:57:16 by danrodr3 #+# #+# */
/* Updated: 2025/10/10 13:57:59 by danrodr3 ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_memcmp(const void *buf1, const void *buf2, size_t count)
{
const unsigned char *b1;
const unsigned char *b2;
b1 = buf1;
b2 = buf2;
while (count--)
{
if (*b1 != *b2)
return (*b1 - *b2);
b1++;
b2++;
}
return (0);
}