bits/syscall.h: add landlock syscalls from linux v5.13
[musl.git] / src / string / strncasecmp.c
blobe0ef93c20de1a9e0a6b8f4a4a951a8e61a1a2973
1 #include <strings.h>
2 #include <ctype.h>
4 int strncasecmp(const char *_l, const char *_r, size_t n)
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);
12 int __strncasecmp_l(const char *l, const char *r, size_t n, locale_t loc)
14 return strncasecmp(l, r, n);
17 weak_alias(__strncasecmp_l, strncasecmp_l);