using malloc() instead of calloc() and sticking to static initializer and struct assignment, not using *c = (Client){}; right now to avoid some ugly gcc warning, possibly a gcc bug since we are using -std=c99
Anselm R Garbe garbeam@gmail.com
Mon, 08 Sep 2008 22:24:05 +0100
1 files changed,
4 insertions(+),
2 deletions(-)
jump to
M
dwm.c
→
dwm.c
@@ -846,12 +846,14 @@ }
void manage(Window w, XWindowAttributes *wa) { + static Client cz; Client *c, *t = NULL; Window trans = None; XWindowChanges wc; - if(!(c = calloc(1, sizeof(Client)))) - die("fatal: could not calloc() %u bytes\n", sizeof(Client)); + if(!(c = malloc(sizeof(Client)))) + die("fatal: could not malloc() %u bytes\n", sizeof(Client)); + *c = cz; c->win = w; /* geometry */