make prop dynamicly allocated

This commit is contained in:
Julien Danjou 2007-09-07 11:12:36 +02:00
parent 75bb6ee238
commit ac67957492
1 changed files with 7 additions and 5 deletions

View File

@ -93,13 +93,15 @@ void
loadjdwmprops(Display *disp, jdwm_config * jdwmconf)
{
int i;
char prop[128];
char *prop;
if(gettextprop(disp, DefaultRootWindow(disp), jdwmprops, prop, sizeof(prop)))
{
for(i = 0; i < jdwmconf->ntags && i < ssizeof(prop) - 1 && prop[i] != '\0'; i++)
prop = p_new(char, jdwmconf->ntags + 1);
if(gettextprop(disp, DefaultRootWindow(disp), jdwmprops, prop, jdwmconf->ntags + 1))
for(i = 0; i < jdwmconf->ntags && prop[i]; i++)
jdwmconf->selected_tags[i] = prop[i] == '1';
}
p_delete(&prop);
}
void