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