MCPcopy Create free account
hub / github.com/Tencent/Hardcoder / case_insensitive_strcmp

Function case_insensitive_strcmp

libapp2sys/src/main/cpp/cjson/cJSON.c:98–119  ·  view source on GitHub ↗

Case insensitive string comparison, doesn't consider two NULL pointers equal though */

Source from the content-addressed store, hash-verified

96
97/* Case insensitive string comparison, doesn't consider two NULL pointers equal though */
98static int case_insensitive_strcmp(const unsigned char *string1, const unsigned char *string2)
99{
100 if ((string1 == NULL) || (string2 == NULL))
101 {
102 return 1;
103 }
104
105 if (string1 == string2)
106 {
107 return 0;
108 }
109
110 for(; tolower(*string1) == tolower(*string2); (void)string1++, string2++)
111 {
112 if (*string1 == '\0')
113 {
114 return 0;
115 }
116 }
117
118 return tolower(*string1) - tolower(*string2);
119}
120
121typedef struct internal_hooks
122{

Callers 1

get_object_itemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected