From f4d9e2e1a1e9cb38e743aea4427b577808786391 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 30 Apr 2017 14:28:06 +0200 Subject: [PATCH] cJSON_strcasecmp -> case_insensitive_strcmp --- cJSON_Utils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cJSON_Utils.c b/cJSON_Utils.c index 5847358..58a7e64 100644 --- a/cJSON_Utils.c +++ b/cJSON_Utils.c @@ -51,7 +51,7 @@ static unsigned char* cJSONUtils_strdup(const unsigned char* const string) } /* Case insensitive string comparison, doesn't consider two NULL pointers equal though */ -static int cJSONUtils_strcasecmp(const unsigned char *string1, const unsigned char *string2) +static int case_insensitive_strcmp(const unsigned char *string1, const unsigned char *string2) { if ((string1 == NULL) || (string2 == NULL)) { @@ -467,7 +467,7 @@ static int cJSONUtils_Compare(cJSON *a, cJSON *b) { int status = 0; /* compare object keys */ - if (cJSONUtils_strcasecmp((unsigned char*)a->string, (unsigned char*)b->string)) + if (case_insensitive_strcmp((unsigned char*)a->string, (unsigned char*)b->string)) { /* missing member */ return -6; @@ -982,7 +982,7 @@ static void cJSONUtils_CompareToPatch(cJSON * const patches, const unsigned char } else { - diff = cJSONUtils_strcasecmp((unsigned char*)from_child->string, (unsigned char*)to_child->string); + diff = case_insensitive_strcmp((unsigned char*)from_child->string, (unsigned char*)to_child->string); } if (diff == 0) @@ -1048,7 +1048,7 @@ static cJSON *cJSONUtils_SortList(cJSON *list) return result; } - while ((current_item != NULL) && (current_item->next != NULL) && (cJSONUtils_strcasecmp((unsigned char*)current_item->string, (unsigned char*)current_item->next->string) < 0)) + while ((current_item != NULL) && (current_item->next != NULL) && (case_insensitive_strcmp((unsigned char*)current_item->string, (unsigned char*)current_item->next->string) < 0)) { /* Test for list sorted. */ current_item = current_item->next; @@ -1087,7 +1087,7 @@ static cJSON *cJSONUtils_SortList(cJSON *list) while ((first != NULL) && (second != NULL)) { cJSON *smaller = NULL; - if (cJSONUtils_strcasecmp((unsigned char*)first->string, (unsigned char*)second->string) < 0) + if (case_insensitive_strcmp((unsigned char*)first->string, (unsigned char*)second->string) < 0) { smaller = first; } -- GitLab