Files
musl/src/string/wcsncasecmp.c
Rich Felker e0614f7cd4 add all missing wchar functions except floating point parsers
these are mostly untested and adapted directly from corresponding byte
string functions and similar.
2012-03-01 23:24:45 -05:00

10 lines
249 B
C

#include <wchar.h>
#include <wctype.h>
int wcsncasecmp(const wchar_t *l, const wchar_t *r, size_t n)
{
if (!n--) return 0;
for (; *l && *r && n && (*l == *r || towlower(*l) == towlower(*r)); l++, r++, n--);
return towlower(*l) - towlower(*r);
}