1597a057d2ad5eb84f335d20e078a43d2f34914f
[reactos.git] / lib / ntdll / string / memicmp.c
1 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
2 #include <string.h>
3 #include <ctype.h>
4
5 /*
6  * @implemented
7  */
8 int
9 _memicmp(const void *s1, const void *s2, size_t n)
10 {
11   if (n != 0)
12   {
13     const unsigned char *p1 = s1, *p2 = s2;
14
15     do {
16       if (toupper(*p1) != toupper(*p2))
17         return (*p1 - *p2);
18       p1++;
19       p2++;
20     } while (--n != 0);
21   }
22   return 0;
23 }