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:
Guy Harris 2006-05-18 12:01:33 +00:00
parent 7866389ea4
commit 635ae7e19a

View File

@ -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.