GetModuleFileName expects the size of the passed buffer to be expressed in TCHAR. We currently pass the size expressed in bytes. In other words, we incorrectly state that the buffer is twice as big as it really is.

svn path=/trunk/; revision=30344
This commit is contained in:
Kovarththanan Rajaratnam 2009-10-05 18:38:50 +00:00
parent 14c4a8f23b
commit 94ff940129
1 changed files with 1 additions and 1 deletions

View File

@ -277,7 +277,7 @@ init_progfile_dir(const char *arg0
* Attempt to get the full pathname of the currently running
* program.
*/
if (GetModuleFileName(NULL, prog_pathname_w, sizeof prog_pathname_w) != 0) {
if (GetModuleFileName(NULL, prog_pathname_w, G_N_ELEMENTS(prog_pathname_w)) != 0) {
/*
* XXX - Should we use g_utf16_to_utf8(), as in
* getenv_utf8()?