From 75e0a1e826b796d1b47963c41c989b22d5f53c63 Mon Sep 17 00:00:00 2001 From: GammaTendonNine Date: Wed, 21 Oct 2020 17:37:39 -0500 Subject: [PATCH] Update cJSON to 1.7.14 --- src/text/libs/cJSON.c | 19 +++++++++---------- src/text/libs/cJSON.h | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/text/libs/cJSON.c b/src/text/libs/cJSON.c index 7518389b..4c6a308e 100644 --- a/src/text/libs/cJSON.c +++ b/src/text/libs/cJSON.c @@ -113,7 +113,7 @@ CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item) } /* This is a safeguard to prevent copy-pasters from using incompatible C and header files */ -#if (CJSON_VERSION_MAJOR != 1) || (CJSON_VERSION_MINOR != 7) || (CJSON_VERSION_PATCH != 13) +#if (CJSON_VERSION_MAJOR != 1) || (CJSON_VERSION_MINOR != 7) || (CJSON_VERSION_PATCH != 14) #error cJSON.h and cJSON.c have different versions. Make sure that both have the same. #endif @@ -1975,15 +1975,6 @@ static cJSON_bool add_item_to_array(cJSON *array, cJSON *item) suffix_object(child->prev, item); array->child->prev = item; } - else - { - while (child->next) - { - child = child->next; - } - suffix_object(child, item); - array->child->prev = item; - } } return true; @@ -2571,6 +2562,7 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count) } p = n; } + a->child->prev = n; return a; } @@ -2607,6 +2599,7 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count) } p = n; } + a->child->prev = n; return a; } @@ -2643,6 +2636,7 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count) } p = n; } + a->child->prev = n; return a; } @@ -2679,6 +2673,7 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char *const *strings, int co } p = n; } + a->child->prev = n; return a; } @@ -2751,6 +2746,10 @@ CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse) } child = child->next; } + if (newitem && newitem->child) + { + newitem->child->prev = newchild; + } return newitem; diff --git a/src/text/libs/cJSON.h b/src/text/libs/cJSON.h index b5ceb290..e97e5f4c 100644 --- a/src/text/libs/cJSON.h +++ b/src/text/libs/cJSON.h @@ -81,7 +81,7 @@ then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJ /* project version */ #define CJSON_VERSION_MAJOR 1 #define CJSON_VERSION_MINOR 7 -#define CJSON_VERSION_PATCH 13 +#define CJSON_VERSION_PATCH 14 #include