| check closing of object and array in a more logical and strict way - json2tsv -… | |
| git clone git://git.codemadness.org/json2tsv | |
| Log | |
| Files | |
| Refs | |
| README | |
| LICENSE | |
| --- | |
| commit d45f1447a26996cfbaf80c5a37a3ba51a48aecb8 | |
| parent 1232e02c50535bb4f9b363a2dada9525260ed059 | |
| Author: Hiltjo Posthuma <[email protected]> | |
| Date: Mon, 14 Oct 2019 22:53:19 +0200 | |
| check closing of object and array in a more logical and strict way | |
| (should have no functional difference though, since it is unreachable) | |
| Diffstat: | |
| M json2tsv.c | 4 ++-- | |
| 1 file changed, 2 insertions(+), 2 deletions(-) | |
| --- | |
| diff --git a/json2tsv.c b/json2tsv.c | |
| @@ -241,8 +241,8 @@ parsejson(void (*cb)(struct json_node *, size_t, const char… | |
| v = 0; | |
| } | |
| if (!depth || | |
| - (nodes[depth - 1].type == TYPE_OBJECT && c == ']')… | |
| - (nodes[depth - 1].type == TYPE_ARRAY && c == '}'))… | |
| + (c == ']' && nodes[depth - 1].type != TYPE_ARRAY) … | |
| + (c == '}' && nodes[depth - 1].type != TYPE_OBJECT)… | |
| *errstr = "unbalanced nodes"; | |
| goto end; | |
| } |