Do some #ifdef'ing to make the Player happy.
[kugel-rb.git] / firmware / common / strcasecmp.c
blob7bd0d61dd579a493f09671628d7c947a63d134b3
2 #include <string.h>
3 #include <ctype.h>
5 int strcasecmp(const char *s1, const char *s2)
7 while (*s1 != '\0' && tolower(*s1) == tolower(*s2)) {
8 s1++;
9 s2++;
12 return tolower(*(unsigned char *) s1) - tolower(*(unsigned char *) s2);
15 int strncasecmp(const char *s1, const char *s2, size_t n)
17 if(!n)
18 return 0;
20 while (n-- != 0 && tolower(*s1) == tolower(*s2)) {
21 if(n == 0 || *s1 == '\0')
22 break;
23 s1++;
24 s2++;
27 return tolower(*(unsigned char *) s1) - tolower(*(unsigned char *) s2);