aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
authorroot <root@lamia.panaceas.james.local>2017-01-16 12:16:27 +0000
committerroot <root@lamia.panaceas.james.local>2017-01-16 12:16:27 +0000
commit4477c392b87bdaaae6780ccadc9a4f4923f2b344 (patch)
treedaef2ccf9b2b1cc8c79e7bd46b379a24f06ce515 /src/util.c
parent8ee35c49abfcc5118b085fe63994b533944b4595 (diff)
downloadtwa_t-4477c392b87bdaaae6780ccadc9a4f4923f2b344.tar.gz
twa_t-4477c392b87bdaaae6780ccadc9a4f4923f2b344.tar.bz2
twa_t-4477c392b87bdaaae6780ccadc9a4f4923f2b344.zip
add source
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
new file mode 100644
index 0000000..022e04b
--- /dev/null
+++ b/src/util.c
@@ -0,0 +1,23 @@
+/*
+ * util.c:
+ *
+ * Copyright (c) 2017 James McKenzie <foss@madingley.org>,
+ * All rights reserved.
+ *
+ */
+
+#include "project.h"
+
+void *
+xmalloc (size_t s)
+{
+ void *ret = malloc (s);
+
+ if (!ret)
+ {
+ fprintf (stderr, "malloc(%lu) failed - aborting\n", s);
+ exit (1);
+ }
+
+ return ret;
+}