MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / cJSON_strcasecmp

Function cJSON_strcasecmp

lib/cJSON.c:115–134  ·  view source on GitHub ↗

case insensitive strcmp */

Source from the content-addressed store, hash-verified

113
114/* case insensitive strcmp */
115static 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

Callers 3

cJSON_GetObjectItemFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected