ti83-sdk/lib83/memcmp.c
2023-10-08 14:58:45 +02:00

14 lines
294 B
C

#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;
}