From 4477c392b87bdaaae6780ccadc9a4f4923f2b344 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 16 Jan 2017 12:16:27 +0000 Subject: add source --- src/util.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/util.c (limited to 'src/util.c') 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 , + * 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; +} -- cgit v1.2.3