diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/common/strcasecmp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/common/strcasecmp.c b/firmware/common/strcasecmp.c index b9dd6c13c4..cdfbe2f81a 100644 --- a/firmware/common/strcasecmp.c +++ b/firmware/common/strcasecmp.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <string.h> | 2 | #include <string.h> |
3 | #include <ctype.h> | 3 | #include <ctype.h> |
4 | 4 | ||
5 | #ifndef strcasecmp | ||
5 | int strcasecmp(const char *s1, const char *s2) | 6 | int strcasecmp(const char *s1, const char *s2) |
6 | { | 7 | { |
7 | while (*s1 != '\0' && tolower(*s1) == tolower(*s2)) { | 8 | while (*s1 != '\0' && tolower(*s1) == tolower(*s2)) { |
@@ -11,7 +12,9 @@ int strcasecmp(const char *s1, const char *s2) | |||
11 | 12 | ||
12 | return tolower(*(unsigned char *) s1) - tolower(*(unsigned char *) s2); | 13 | return tolower(*(unsigned char *) s1) - tolower(*(unsigned char *) s2); |
13 | } | 14 | } |
15 | #endif | ||
14 | 16 | ||
17 | #ifndef strncasecmp | ||
15 | int strncasecmp(const char *s1, const char *s2, size_t n) | 18 | int strncasecmp(const char *s1, const char *s2, size_t n) |
16 | { | 19 | { |
17 | int d = 0; | 20 | int d = 0; |
@@ -26,3 +29,4 @@ int strncasecmp(const char *s1, const char *s2, size_t n) | |||
26 | 29 | ||
27 | return d; | 30 | return d; |
28 | } | 31 | } |
32 | #endif | ||