From 060cff4970e0dd1b71f831475503665d2dfdeb24 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 7 Sep 2007 11:14:43 +0200 Subject: [PATCH] make prop in save() dynamic --- layout.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/layout.c b/layout.c index 7c4d22249..c4072b405 100644 --- a/layout.c +++ b/layout.c @@ -142,12 +142,14 @@ void savejdwmprops(Display *disp, jdwm_config *jdwmconf) { int i; - char prop[128]; + char *prop; - for(i = 0; i < jdwmconf->ntags && i < ssizeof(prop) - 1; i++) + prop = p_new(char, jdwmconf->ntags + 1); + for(i = 0; i < jdwmconf->ntags; i++) prop[i] = jdwmconf->selected_tags[i] ? '1' : '0'; prop[i] = '\0'; XChangeProperty(disp, DefaultRootWindow(disp), jdwmprops, XA_STRING, 8, PropModeReplace, (unsigned char *) prop, i); + p_delete(&prop); } void