memcmp.c
318 Bytes
#include <PR/os.h>
#include "common.h"
/*
* Extra stdlib function not supplied by libultra
*/
int memcmp(const void *s1, const void *s2, size_t n)
{
const u8* a = s1, * b = s2;
u8 a1, b1;
while (n-- > 0) {
if ((a1 = *a++) == (b1 = *b++)) continue;
return a1 - b1;
}
return 0;
}