Skip to content

Commit 12c4bf1

Browse files
vwvwAlanscut
authored andcommitted
Wrong counter increment
1 parent 9d1b229 commit 12c4bf1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cJSON.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2794,7 +2794,7 @@ cJSON * cJSON_Duplicate_rec(const cJSON *item, size_t depth, cJSON_bool recurse)
27942794
if(depth >= CJSON_CIRCULAR_LIMIT) {
27952795
goto fail;
27962796
}
2797-
newchild = cJSON_Duplicate_rec(child, ++depth, true); /* Duplicate (with recurse) each item in the ->next chain */
2797+
newchild = cJSON_Duplicate_rec(child, depth + 1, true); /* Duplicate (with recurse) each item in the ->next chain */
27982798
if (!newchild)
27992799
{
28002800
goto fail;

0 commit comments

Comments
 (0)