projects
/
musl
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
4f9230e190837394a3890f18c8c3f53099a2c145
[musl]
/
strncasecmp.c
1
#include <strings.h>
2
#include <ctype.h>
3
4
int strncasecmp(const char *_l, const char *_r, size_t n)
5
{
6
const unsigned char *l=_l, *r=_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
}