From dc5d967ee61046f899b3b49daeb9268c8161844a Mon Sep 17 00:00:00 2001 From: "arg@10ksloc.org" Date: Thu, 20 Jul 2006 12:18:06 +0200 Subject: cleaned up code --- util.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'util.c') diff --git a/util.c b/util.c index 1e36b25..94590f9 100644 --- a/util.c +++ b/util.c @@ -26,6 +26,7 @@ void * emallocz(unsigned int size) { void *res = calloc(1, size); + if(!res) bad_malloc(size); return res; @@ -34,6 +35,7 @@ emallocz(unsigned int size) void eprint(const char *errstr, ...) { va_list ap; + va_start(ap, errstr); vfprintf(stderr, errstr, ap); va_end(ap); @@ -44,6 +46,7 @@ void spawn(Arg *arg) { char **argv = (char **)arg->argv; + if(!argv || !argv[0]) return; if(fork() == 0) { -- cgit v1.2.3