GetModuleFileName expects the size of the passed buffer to be expressed in TCHAR...
authorkrj <krj@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 5 Oct 2009 18:38:50 +0000 (18:38 +0000)
committerkrj <krj@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 5 Oct 2009 18:38:50 +0000 (18:38 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30344 f5534014-38df-0310-8fa8-9805f1628bb7

epan/filesystem.c

index 5acecec42c686f9740b0d3b206451c4a3efb0fca..596c39962d2dddf29dc89b959732771184d9836e 100644 (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()?