1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-31 13:05:52 +01:00

WINGs: Plug potential segfault

...following up on d65cb5a ("Preparing to do exactly as FIXME says").

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
This commit is contained in:
Tamas TEVESZ
2010-09-28 03:39:31 +02:00
committed by Carlos R. Mafra
parent 94a0c7b42f
commit 752d084609

View File

@@ -51,20 +51,20 @@ char *wusergnusteppath()
char *gspath; char *gspath;
int pathlen; int pathlen;
if (!path) { gspath = getenv("GNUSTEP_USER_ROOT");
gspath = getenv("GNUSTEP_USER_ROOT"); if (gspath) {
gspath = wexpandpath(gspath);
if (gspath) { if (gspath) {
gspath = wexpandpath(gspath);
pathlen = strlen(gspath) + 4; pathlen = strlen(gspath) + 4;
path = wmalloc(pathlen); path = wmalloc(pathlen);
strcpy(path, gspath); strcpy(path, gspath);
wfree(gspath); wfree(gspath);
} else {
pathlen = strlen(wgethomedir()) + 10;
path = wmalloc(pathlen);
strcpy(path, wgethomedir());
strcat(path, "/GNUstep");
} }
} else {
pathlen = strlen(wgethomedir()) + 10;
path = wmalloc(pathlen);
strcpy(path, wgethomedir());
strcat(path, "/GNUstep");
} }
return path; return path;