Don't store address of local variable in hashtable.
authorTor Lillqvist <tml@iki.fi>
Sat, 10 Feb 2001 00:17:06 +0000 (00:17 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sat, 10 Feb 2001 00:17:06 +0000 (00:17 +0000)
2001-02-10  Tor Lillqvist  <tml@iki.fi>

* gwin32.c (get_package_directory_from_module): Don't store
address of local variable in hashtable.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/gwin32.c
gwin32.c

index fed2109..035040a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-02-10  Tor Lillqvist  <tml@iki.fi>
+
+       * gwin32.c (get_package_directory_from_module): Don't store
+       address of local variable in hashtable.
+
 2001-02-08  Fatih Demir        <kabalak@kabalak.net>
 
        * configure.in: Added "tr" to ALL_LINGUAS.
index fed2109..035040a 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-10  Tor Lillqvist  <tml@iki.fi>
+
+       * gwin32.c (get_package_directory_from_module): Don't store
+       address of local variable in hashtable.
+
 2001-02-08  Fatih Demir        <kabalak@kabalak.net>
 
        * configure.in: Added "tr" to ALL_LINGUAS.
index fed2109..035040a 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-10  Tor Lillqvist  <tml@iki.fi>
+
+       * gwin32.c (get_package_directory_from_module): Don't store
+       address of local variable in hashtable.
+
 2001-02-08  Fatih Demir        <kabalak@kabalak.net>
 
        * configure.in: Added "tr" to ALL_LINGUAS.
index fed2109..035040a 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-10  Tor Lillqvist  <tml@iki.fi>
+
+       * gwin32.c (get_package_directory_from_module): Don't store
+       address of local variable in hashtable.
+
 2001-02-08  Fatih Demir        <kabalak@kabalak.net>
 
        * configure.in: Added "tr" to ALL_LINGUAS.
index fed2109..035040a 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-10  Tor Lillqvist  <tml@iki.fi>
+
+       * gwin32.c (get_package_directory_from_module): Don't store
+       address of local variable in hashtable.
+
 2001-02-08  Fatih Demir        <kabalak@kabalak.net>
 
        * configure.in: Added "tr" to ALL_LINGUAS.
index fed2109..035040a 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-10  Tor Lillqvist  <tml@iki.fi>
+
+       * gwin32.c (get_package_directory_from_module): Don't store
+       address of local variable in hashtable.
+
 2001-02-08  Fatih Demir        <kabalak@kabalak.net>
 
        * configure.in: Added "tr" to ALL_LINGUAS.
index fed2109..035040a 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-10  Tor Lillqvist  <tml@iki.fi>
+
+       * gwin32.c (get_package_directory_from_module): Don't store
+       address of local variable in hashtable.
+
 2001-02-08  Fatih Demir        <kabalak@kabalak.net>
 
        * configure.in: Added "tr" to ALL_LINGUAS.
index fed2109..035040a 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-10  Tor Lillqvist  <tml@iki.fi>
+
+       * gwin32.c (get_package_directory_from_module): Don't store
+       address of local variable in hashtable.
+
 2001-02-08  Fatih Demir        <kabalak@kabalak.net>
 
        * configure.in: Added "tr" to ALL_LINGUAS.
index 2a832cd..4730711 100644 (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)
index 2a832cd..4730711 100644 (file)
--- a/gwin32.c
+++ b/gwin32.c
@@ -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)