Allocate enough space for the 0-terminator.

This resulted in kcompmgr sometimes not being able to read the config file.

Bug found and fixed by Dennis Kasprzyk <cyber.labs@gmx.de>

svn path=/trunk/kdebase/kwin/; revision=384644
This commit is contained in:
Volker Krause 2005-01-31 18:51:40 +00:00
parent 552589b141
commit e3d4b11e14

View file

@ -2146,7 +2146,7 @@ loadConfig(char *filename){
wasNull = True; wasNull = True;
const char *home = getenv("HOME"); const char *home = getenv("HOME");
const char *configfile = "/.xcompmgrrc"; const char *configfile = "/.xcompmgrrc";
filename = (char*)malloc((strlen(home)+strlen(configfile))*sizeof(char)); filename = (char*)malloc((strlen(home)+strlen(configfile)+1)*sizeof(char));
strcat(filename, home); strcat(filename, home);
strcat(filename, configfile); strcat(filename, configfile);