From e3d4b11e14883cf523201d15b982c9814a9f05a6 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Mon, 31 Jan 2005 18:51:40 +0000 Subject: [PATCH] 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 svn path=/trunk/kdebase/kwin/; revision=384644 --- kompmgr/kompmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kompmgr/kompmgr.c b/kompmgr/kompmgr.c index a9b9f57989..7d9238a133 100644 --- a/kompmgr/kompmgr.c +++ b/kompmgr/kompmgr.c @@ -2146,7 +2146,7 @@ loadConfig(char *filename){ wasNull = True; const char *home = getenv("HOME"); 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, configfile);