ti83-sdk/lib83/memcmp.c

14 lines
294 B
C
Raw Normal View History

2023-10-08 12:58:45 +00:00
#include <string.h>
int8_t memcmp(void * buf1, void * buf2, size_t count) {
if (!count) return 0;
while (--count && *(unsigned char*)buf1 == *(unsigned char*)buf2) {
buf1 = 1 + (unsigned char *)buf1; buf2 = 1 + (unsigned char *)buf2;
}
return *(char*)buf1 - *(char*)buf2;
}