aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Badoux <n.badoux@hotmail.com>2024-08-30 15:09:28 +0200
committerAlan Wang <wp_scut@163.com>2024-09-23 19:08:58 +0800
commit12c4bf1986c288950a3d06da757109a6aa1ece38 (patch)
tree238c7dbe568bf0a989fabf8858297e0ed64cc329
parent9d1b229086a7b069fb5f4e3be0226a22480a6707 (diff)
downloadcjson-12c4bf1986c288950a3d06da757109a6aa1ece38.tar.gz
cjson-12c4bf1986c288950a3d06da757109a6aa1ece38.zip
Wrong counter incrementHEADmaster
-rw-r--r--cJSON.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cJSON.c b/cJSON.c
index 9399c0d..d7c7236 100644
--- a/cJSON.c
+++ b/cJSON.c
@@ -2794,7 +2794,7 @@ cJSON * cJSON_Duplicate_rec(const cJSON *item, size_t depth, cJSON_bool recurse)
if(depth >= CJSON_CIRCULAR_LIMIT) {
goto fail;
}
- newchild = cJSON_Duplicate_rec(child, ++depth, true); /* Duplicate (with recurse) each item in the ->next chain */
+ newchild = cJSON_Duplicate_rec(child, depth + 1, true); /* Duplicate (with recurse) each item in the ->next chain */
if (!newchild)
{
goto fail;