update for HEAD-2003091401
[reactos.git] / lib / string / memcmp.c
1 /*
2  * $Id$
3  */
4
5 #include <string.h>
6
7 int memcmp(const void *s1, const void *s2, size_t n)
8 {
9     if (n != 0) {
10         const unsigned char *p1 = s1, *p2 = s2;
11         do {
12             if (*p1++ != *p2++)
13                     return (*--p1 - *--p2);
14         } while (--n != 0);
15     }
16     return 0;
17 }