check closing of object and array in a more logical and strict way - json2tsv - JSON to TSV converter
 (HTM) git clone git://git.codemadness.org/json2tsv
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit d45f1447a26996cfbaf80c5a37a3ba51a48aecb8
 (DIR) parent 1232e02c50535bb4f9b363a2dada9525260ed059
 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
       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(-)
       ---
 (DIR) diff --git a/json2tsv.c b/json2tsv.c
       @@ -241,8 +241,8 @@ parsejson(void (*cb)(struct json_node *, size_t, const char *), const char **err
                                        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;
                                }