blob: ff300160ba05a9cc1999edd0699bf678fe6235cc [file] [log] [blame]
/*
* memcmp.c
*/
#include <memcmp.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;
}