diff options
author | Freya Murphy <freya@freyacat.org> | 2023-12-15 23:16:47 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2023-12-15 23:16:47 -0500 |
commit | afda43984e84b6cf04bc72d5fea6551e5bd83c29 (patch) | |
tree | a70e643785c5fafadb6704e0145c22ba3948a3ad /src/main.c | |
parent | fix text size (diff) | |
download | nbtvis-afda43984e84b6cf04bc72d5fea6551e5bd83c29.tar.gz nbtvis-afda43984e84b6cf04bc72d5fea6551e5bd83c29.tar.bz2 nbtvis-afda43984e84b6cf04bc72d5fea6551e5bd83c29.zip |
dont allow empty compound key names
Diffstat (limited to '')
-rw-r--r-- | src/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1,4 +1,5 @@ #include "lib.h" +#include "stream.h" #include "tag.h" #include "flags.h" @@ -42,12 +43,15 @@ int main(int argc, char **argv) { tag_t tag; if (tag_read(&tag, &flags.in, flags.fin) == false) error_and_die("error: failed to read tag\n"); + stream_close(&flags.in); if (tag.type != TAG_COMPOUND) error_and_die("error: nbt tag not a valid compound tag\n"); if (tag_print(&tag, &flags.out, flags.fout) == false) error_and_die("error: failed to write tag\n"); + stream_close(&flags.out); + tag_free(&tag); return 0; |