Mostly minor updates to the source tree for portcls.
[reactos.git] / reactos / lib / sdk / crt / string / strnicmp.c
1 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
2 #include <precomp.h>
3
4 /*
5 * @implemented
6 */
7 int _strnicmp(const char *s1, const char *s2, size_t n)
8 {
9
10 if (n == 0)
11 return 0;
12 do {
13 if (toupper(*s1) != toupper(*s2++))
14 return toupper(*(unsigned const char *)s1) - toupper(*(unsigned const char *)--s2);
15 if (*s1++ == 0)
16 break;
17 } while (--n != 0);
18 return 0;
19 }