case insensitive strcmp */
| 113 | |
| 114 | /* case insensitive strcmp */ |
| 115 | static int cJSON_strcasecmp(const unsigned char *s1, const unsigned char *s2) |
| 116 | { |
| 117 | if (!s1) |
| 118 | { |
| 119 | return (s1 == s2) ? 0 : 1; /* both NULL? */ |
| 120 | } |
| 121 | if (!s2) |
| 122 | { |
| 123 | return 1; |
| 124 | } |
| 125 | for(; tolower(*s1) == tolower(*s2); ++s1, ++s2) |
| 126 | { |
| 127 | if (*s1 == '\0') |
| 128 | { |
| 129 | return 0; |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | return tolower(*s1) - tolower(*s2); |
| 134 | } |
| 135 | |
| 136 | #if defined(__GNUC__) || defined(__clang__) |
| 137 | #define CJSON_TLS __thread |
no outgoing calls
no test coverage detected