00001 /* Public domain. */ 00002 #include <stddef.h> 00003 00004 int 00005 memcmp (const void *str1, const void *str2, size_t count) 00006 { 00007 const unsigned char *s1 = str1; 00008 const unsigned char *s2 = str2; 00009 00010 while (count-- > 0) 00011 { 00012 if (*s1++ != *s2++) 00013 return s1[-1] < s2[-1] ? -1 : 1; 00014 } 00015 return 0; 00016 }
1.5.6