update for HEAD-2003050101
[reactos.git] / lib / msvcrt / string / memcmp.c
1 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
2 #include <msvcrt/string.h>
3
4 #pragma function(memcmp)
5
6 int memcmp(const void *s1, const void *s2, size_t n)
7 {
8     if (n != 0) {
9         const unsigned char *p1 = s1, *p2 = s2;
10         do {
11             if (*p1++ != *p2++)
12                     return (*--p1 - *--p2);
13         } while (--n != 0);
14     }
15     return 0;
16 }