ref: ba7282c77fe93ec17c42d1a3a11fbd4109d93616
dir: /src/libc/string/memcmp.c/
#include <string.h> #undef memcmp int memcmp(const void *s1, const void *s2, size_t n) { const unsigned char *s = s1; const unsigned char *t = s2; for (; n > 0 && *s == *t; --n) ++s, ++t; return (n > 0) ? *s - *t : 0; }