From 62a929a2314af7ad5d5fcbf65764f5006ce92e94 Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 20 Mar 2000 02:15:48 +0000 Subject: [PATCH] Fixed crashing bug in wmsetbg.c --- util/wmsetbg.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/util/wmsetbg.c b/util/wmsetbg.c index 428fb890..ddbe9244 100644 --- a/util/wmsetbg.c +++ b/util/wmsetbg.c @@ -1151,18 +1151,13 @@ getFullPixmapPath(char *file) char *tmp; if (!PixmapPath || !(tmp = wfindfile(PixmapPath, file))) { - char *path = malloc(1024); int bsize = 512; - - if (!path) - return file; + char *path = wmalloc(bsize); while (!getcwd(path, bsize)) { free(path); - bsize += 64; + bsize += bsize/2; path = malloc(bsize); - if (!path) - return file; } tmp = wstrappend(path, "/"); @@ -1176,7 +1171,7 @@ getFullPixmapPath(char *file) /* the file is in the PixmapPath */ free(tmp); - return file; + return wstrdup(file); } -- 2.11.4.GIT