MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / strncasecmp

Function strncasecmp

system/lib/libc/musl/src/string/strncasecmp.c:4–10  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include <ctype.h>
3
4int strncasecmp(const char *_l, const char *_r, size_t n)
5{
6 const unsigned char *l=(void *)_l, *r=(void *)_r;
7 if (!n--) return 0;
8 for (; *l && *r && n && (*l == *r || tolower(*l) == tolower(*r)); l++, r++, n--);
9 return tolower(*l) - tolower(*r);
10}
11
12int __strncasecmp_l(const char *l, const char *r, size_t n, locale_t loc)
13{

Callers 4

mainFunction · 0.85
strcasestrFunction · 0.85
__strncasecmp_lFunction · 0.85
strptimeFunction · 0.85

Calls 1

tolowerFunction · 0.50

Tested by 1

mainFunction · 0.68