Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
preparing 0.6 which will be available in the evening after sanders patch approx.
[dwm.git]
/
util.c
diff --git
a/util.c
b/util.c
index
1e36b25
..
94590f9
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-26,6
+26,7
@@
void *
emallocz(unsigned int size)
{
void *res = calloc(1, size);
emallocz(unsigned int size)
{
void *res = calloc(1, size);
+
if(!res)
bad_malloc(size);
return res;
if(!res)
bad_malloc(size);
return res;
@@
-34,6
+35,7
@@
emallocz(unsigned int size)
void
eprint(const char *errstr, ...) {
va_list ap;
void
eprint(const char *errstr, ...) {
va_list ap;
+
va_start(ap, errstr);
vfprintf(stderr, errstr, ap);
va_end(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;
spawn(Arg *arg)
{
char **argv = (char **)arg->argv;
+
if(!argv || !argv[0])
return;
if(fork() == 0) {
if(!argv || !argv[0])
return;
if(fork() == 0) {