diff options
-rw-r--r-- | cJSON.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |