projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
initial check-in, version 0.5.0
[oweals/musl.git]
/
src
/
string
/
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
}