diff options
author | Freya Murphy <freya@freyacat.org> | 2023-12-16 11:47:59 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2023-12-16 11:47:59 -0500 |
commit | 85ba301f52b1c7e1ad928803b14b6c70776f2235 (patch) | |
tree | 28902147b9bf6c393497e21b0cb21c8b957aa3e2 /src/lib.c | |
parent | fix hang on incomplete json ident (diff) | |
download | nbtvis-85ba301f52b1c7e1ad928803b14b6c70776f2235.tar.gz nbtvis-85ba301f52b1c7e1ad928803b14b6c70776f2235.tar.bz2 nbtvis-85ba301f52b1c7e1ad928803b14b6c70776f2235.zip |
use hashmap for compound tag
Diffstat (limited to 'src/lib.c')
-rw-r--r-- | src/lib.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -3,6 +3,7 @@ #include <stdarg.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> __attribute__((__noreturn__)) static void die() { @@ -36,6 +37,12 @@ void *xalloc(size_t amount) { return res; } +void *xzalloc(size_t amount) { + void *res = xalloc(amount); + memset(res, 0, sizeof(amount)); + return res; +} + void *xrealloc(void *ptr, size_t amount) { void *res = realloc(ptr, amount); if (res == NULL) |