MCPcopy Create free account
hub / github.com/NetHack/NetHack / strncmpi

Function strncmpi

outdated/sys/wince/winmain.c:101–118  ·  view source on GitHub ↗
(s1, s2, n)

Source from the content-addressed store, hash-verified

99}
100
101int strncmpi(s1, s2, n) /* case insensitive counted string comparison */
102register const char *s1, *s2;
103register int n; /*(should probably be size_t, which is usually unsigned)*/
104{ /*{ aka strncasecmp }*/
105 register char t1, t2;
106
107 while (n--) {
108 if (!*s2)
109 return (*s1 != 0); /* s1 >= s2 */
110 else if (!*s1)
111 return -1; /* s1 < s2 */
112 t1 = lowc(*s1++);
113 t2 = lowc(*s2++);
114 if (t1 != t2)
115 return (t1 > t2) ? 1 : -1;
116 }
117 return 0; /* s1 == s2 */
118}
119#endif /* STRNCMPI */

Callers 2

_stricmpFunction · 0.70
topl_keyFunction · 0.50

Calls 1

lowcFunction · 0.70

Tested by

no test coverage detected