1 #include <string.h> 2 3 int memcmp(const void *cs, const void *ct, size_t count) 4 { 5 const unsigned char *su1, *su2; 6 int res = 0; 7 8 for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--) 9 if ((res = *su1 - *su2) != 0) 10 break; 11 return res; 12 } 13