mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 21:08:08 +01:00
Fixed crashing bug in wmsetbg.c
This commit is contained in:
@@ -1151,18 +1151,13 @@ getFullPixmapPath(char *file)
|
|||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
if (!PixmapPath || !(tmp = wfindfile(PixmapPath, file))) {
|
if (!PixmapPath || !(tmp = wfindfile(PixmapPath, file))) {
|
||||||
char *path = malloc(1024);
|
|
||||||
int bsize = 512;
|
int bsize = 512;
|
||||||
|
char *path = wmalloc(bsize);
|
||||||
if (!path)
|
|
||||||
return file;
|
|
||||||
|
|
||||||
while (!getcwd(path, bsize)) {
|
while (!getcwd(path, bsize)) {
|
||||||
free(path);
|
free(path);
|
||||||
bsize += 64;
|
bsize += bsize/2;
|
||||||
path = malloc(bsize);
|
path = malloc(bsize);
|
||||||
if (!path)
|
|
||||||
return file;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = wstrappend(path, "/");
|
tmp = wstrappend(path, "/");
|
||||||
@@ -1176,7 +1171,7 @@ getFullPixmapPath(char *file)
|
|||||||
/* the file is in the PixmapPath */
|
/* the file is in the PixmapPath */
|
||||||
free(tmp);
|
free(tmp);
|
||||||
|
|
||||||
return file;
|
return wstrdup(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user