2015-01-03 Sandra Loosemore <sandra@codesourcery.com>
[official-gcc.git] / libgcc / memcmp.c
blob2348afe1d27f7101adaa1970ee7f040e2343f35c
1 /* Public domain. */
2 #include <stddef.h>
4 int
5 memcmp (const void *str1, const void *str2, size_t count)
7 const unsigned char *s1 = str1;
8 const unsigned char *s2 = str2;
10 while (count-- > 0)
12 if (*s1++ != *s2++)
13 return s1[-1] < s2[-1] ? -1 : 1;
15 return 0;