summaryrefslogtreecommitdiffstats
path: root/helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'helpers.c')
-rw-r--r--helpers.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/helpers.c b/helpers.c
index c93b774..2cd119d 100644
--- a/helpers.c
+++ b/helpers.c
@@ -1,8 +1,16 @@
+#include <assert.h>
#include <locale.h>
#include <stdarg.h>
+#include <stdlib.h>
#include "helpers.h"
+void *xmalloc(size_t size) {
+ void *ptr = malloc((size ? size : 1));
+ assert(ptr != NULL);
+ return ptr;
+}
+
void cursinit(void) {
setlocale(LC_ALL, "");
initscr();