As suggested by Jim Prince, pass the right argument to "getcwd()" - the
buffer argument is a mallocated buffer, so sizeof doesn't return its size, it returns the size of the pointer to the buffer. Fixes bug 907. svn path=/trunk/; revision=18186
This commit is contained in:
parent
7866389ea4
commit
635ae7e19a
@ -342,7 +342,7 @@ init_progfile_dir(const char *arg0
|
||||
strerror(errno));
|
||||
}
|
||||
curdir = g_malloc(path_max);
|
||||
if (getcwd(curdir, sizeof curdir) == NULL) {
|
||||
if (getcwd(curdir, path_max) == NULL) {
|
||||
/*
|
||||
* It failed - give up, and just stick
|
||||
* with DATAFILE_DIR.
|
||||
|
Loading…
x
Reference in New Issue
Block a user