Sign in
googlers
/
maze
/
klibc
/
21d243929559c0f1711bfef02defe023394a823e
/
.
/
klibc
/
memcmp.c
blob: 9dda5a45588bf6c9fbf95821eb18f4f44c21b452 [
file
] [
log
] [
blame
]
/*
* memcmp.c
*/
#include
<string.h>
int
memcmp
(
const
void
*
s1
,
const
void
*
s2
,
size_t
n
)
{
const
unsigned
char
*
c1
=
s1
,
*
c2
=
s2
;
int
d
=
0
;
while
(
n
--
)
{
d
=
(
int
)*
c2
++
-
(
int
)*
c1
++;
if
(
d
)
break
;
}
return
d
;
}