about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-09-08 22:24:05 +0100
committerAnselm R Garbe <garbeam@gmail.com>2008-09-08 22:24:05 +0100
commit53cac176928b67db4eb551295291ab09650927eb (patch)
tree79c695612a4255eb24d5448be7a93ec01b510464
parent83abfc05eb5a1e6ee762ce2921d9d5270e40c9ee (diff)
downloaddwm-53cac176928b67db4eb551295291ab09650927eb.tar.gz
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 5.2
-rw-r--r--dwm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/dwm.c b/dwm.c
index dd39fe1..09f3ae1 100644
--- a/dwm.c
+++ b/dwm.c
@@ -846,12 +846,14 @@ killclient(const Arg *arg) {
 
 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 */