diff options
Diffstat (limited to '')
-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) |