X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=util.c;h=94590f9233e397ccccb0f971b3376befe8ddfab7;hp=1e36b2575e902dc36a4ae908df6afac6e15bd4d9;hb=dc5d967ee61046f899b3b49daeb9268c8161844a;hpb=fe3756c8e17f64d9b2aba93db28cb780f303f606 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) {