Wrong counter increment

This commit is contained in:
Nicolas Badoux authored and Alan Wang committed 2024-09-23 19:08:58 +08:00
1 parent 9d1b229086
commit 12c4bf1986
1 file changed
+1 -1
+1 -1
View File
@@ -2794,7 +2794,7 @@ cJSON * cJSON_Duplicate_rec(const cJSON *item, size_t depth, cJSON_bool recurse)
if(depth >= CJSON_CIRCULAR_LIMIT) { if(depth >= CJSON_CIRCULAR_LIMIT) {
goto fail; 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) if (!newchild)
{ {
goto fail; goto fail;