make prop in save() dynamic

This commit is contained in:
Julien Danjou 2007-09-07 11:14:43 +02:00
parent ac67957492
commit 060cff4970
1 changed files with 4 additions and 2 deletions

View File

@ -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