From ab346d1a99a426f2872b88d5411fc971c6217c3e Mon Sep 17 00:00:00 2001 From: Richard Heatley Date: Sun, 27 Nov 2022 21:31:42 +0000 Subject: [PATCH] bug fixed --- code/source/adt.c | 3 ++- code/source/parsers/json.c | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/source/adt.c b/code/source/adt.c index 2d0783c6..40d70a60 100644 --- a/code/source/adt.c +++ b/code/source/adt.c @@ -229,7 +229,8 @@ zpl_adt_node *zpl_adt_alloc_at(zpl_adt_node *parent, zpl_isize index) { zpl_adt_node o = {0}; o.parent = parent; - zpl_array_append_at(parent->nodes, o, index); + if (!zpl_array_append_at(parent->nodes, o, index)) + return NULL; return parent->nodes + index; } diff --git a/code/source/parsers/json.c b/code/source/parsers/json.c index a8c92fc0..dbe55f5d 100644 --- a/code/source/parsers/json.c +++ b/code/source/parsers/json.c @@ -383,7 +383,6 @@ zpl_b8 zpl_json_write(zpl_file *f, zpl_adt_node *o, zpl_isize indent) { if (o->nodes) { zpl_isize cnt = zpl_array_count(o->nodes); - fprintf(stderr, "HERE %zi", cnt); for (int i = 0; i < cnt; ++i) { if (!zpl__json_write_value(f, o->nodes + i, o, indent, false, !(i < cnt - 1))) return false;