X-Git-Url: http://git.ozlabs.org/?p=yaboot.git;a=blobdiff_plain;f=lib%2Fctype.c;h=edd533c6de83d2ebc279bcb31058eaddb3360559;hp=e028af4422bf7114c4f74f0b097903f22a1ca93f;hb=a5eb5ac3f50c7a4d532043dc9006fcf8eaf43c3e;hpb=f4ebbd9f7ea23e3f0fcbe098754580c220894628 diff --git a/lib/ctype.c b/lib/ctype.c index e028af4..edd533c 100644 --- a/lib/ctype.c +++ b/lib/ctype.c @@ -44,3 +44,11 @@ int strcasecmp(const char *s1, const char *s2) } } +int strncasecmp(const char *cs,const char *ct,size_t n) +{ + signed char __res = 0; + while (n--) + if ((__res = tolower(*cs) - tolower(*ct++)) != 0 || !*cs++) + break; + return __res; +}