Don't store address of local variable in hashtable.

2001-02-10  Tor Lillqvist  <tml@iki.fi>

	* gwin32.c (get_package_directory_from_module): Don't store
	address of local variable in hashtable.
This commit is contained in:
Tor Lillqvist
2001-02-10 00:17:06 +00:00
committed by Tor Lillqvist
parent 41de921c50
commit bf8cdc4655
10 changed files with 46 additions and 4 deletions

View File

@@ -850,7 +850,7 @@ get_package_directory_from_module (gchar *module_name)
{
static GHashTable *module_dirs = NULL;
HMODULE hmodule = NULL;
gchar fn[MAX_PATH];
gchar *fn;
gchar *p;
gchar *result;
@@ -869,7 +869,8 @@ get_package_directory_from_module (gchar *module_name)
return NULL;
}
if (!GetModuleFileName (hmodule, fn, sizeof (fn)))
fn = g_malloc (MAX_PATH);
if (!GetModuleFileName (hmodule, fn, MAX_PATH))
return NULL;
if ((p = strrchr (fn, '\\')) != NULL)