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 53cac176
Anselm R Garbe · 2008-09-08 22:24 1 file(s) · +4 −2
dwm.c +4 −2
846 846
847 847
void
848 848
manage(Window w, XWindowAttributes *wa) {
849 +
	static Client cz;
849 850
	Client *c, *t = NULL;
850 851
	Window trans = None;
851 852
	XWindowChanges wc;
852 853
853 -
	if(!(c = calloc(1, sizeof(Client))))
854 -
		die("fatal: could not calloc() %u bytes\n", sizeof(Client));
854 +
	if(!(c = malloc(sizeof(Client))))
855 +
		die("fatal: could not malloc() %u bytes\n", sizeof(Client));
856 +
	*c = cz;
855 857
	c->win = w;
856 858
857 859
	/* geometry */