json: fix code that could have a side-effects - json2tsv - JSON to TSV converter | |
git clone git://git.codemadness.org/json2tsv | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit e889775a6c3962a1d043c5316beb956cd8f0cb05 | |
parent 5c614ee9fef3c53e5c046b5fc2af19253a2899b5 | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Fri, 12 Nov 2021 11:22:48 +0100 | |
json: fix code that could have a side-effects | |
It found a bug in the scc compiler. | |
Diffstat: | |
M json.c | 3 ++- | |
1 file changed, 2 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/json.c b/json.c | |
@@ -246,7 +246,8 @@ escchr: | |
(c == '}' && nodes[depth - 1].type != JSON_TYPE_OBJ… | |
JSON_INVALID(); /* unbalanced nodes */ | |
- nodes[--depth].index++; | |
+ depth--; | |
+ nodes[depth].index++; | |
expect = EXPECT_END; | |
break; | |
case ',': |