As suggested by Jim Prince, pass the right argument to "getcwd()" - the
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 18 May 2006 12:01:33 +0000 (12:01 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 18 May 2006 12:01:33 +0000 (12:01 +0000)
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.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18186 f5534014-38df-0310-8fa8-9805f1628bb7

epan/filesystem.c

index 24b93005994a15633e76023a1ab823bb21d0d400..d2b78fd13e296ea90f0743ade9a0e73510b2cc19 100644 (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.