From bf8cdc465590834a53a16a9aa3a7c8eb417894eb Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sat, 10 Feb 2001 00:17:06 +0000 Subject: [PATCH] Don't store address of local variable in hashtable. 2001-02-10 Tor Lillqvist * gwin32.c (get_package_directory_from_module): Don't store address of local variable in hashtable. --- ChangeLog | 5 +++++ ChangeLog.pre-2-0 | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-12 | 5 +++++ ChangeLog.pre-2-2 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ glib/gwin32.c | 5 +++-- gwin32.c | 5 +++-- 10 files changed, 46 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index fed2109..035040a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-02-10 Tor Lillqvist + + * gwin32.c (get_package_directory_from_module): Don't store + address of local variable in hashtable. + 2001-02-08 Fatih Demir * configure.in: Added "tr" to ALL_LINGUAS. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index fed2109..035040a 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,8 @@ +2001-02-10 Tor Lillqvist + + * gwin32.c (get_package_directory_from_module): Don't store + address of local variable in hashtable. + 2001-02-08 Fatih Demir * configure.in: Added "tr" to ALL_LINGUAS. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index fed2109..035040a 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2001-02-10 Tor Lillqvist + + * gwin32.c (get_package_directory_from_module): Don't store + address of local variable in hashtable. + 2001-02-08 Fatih Demir * configure.in: Added "tr" to ALL_LINGUAS. diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index fed2109..035040a 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +2001-02-10 Tor Lillqvist + + * gwin32.c (get_package_directory_from_module): Don't store + address of local variable in hashtable. + 2001-02-08 Fatih Demir * configure.in: Added "tr" to ALL_LINGUAS. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index fed2109..035040a 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +2001-02-10 Tor Lillqvist + + * gwin32.c (get_package_directory_from_module): Don't store + address of local variable in hashtable. + 2001-02-08 Fatih Demir * configure.in: Added "tr" to ALL_LINGUAS. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index fed2109..035040a 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +2001-02-10 Tor Lillqvist + + * gwin32.c (get_package_directory_from_module): Don't store + address of local variable in hashtable. + 2001-02-08 Fatih Demir * configure.in: Added "tr" to ALL_LINGUAS. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index fed2109..035040a 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +2001-02-10 Tor Lillqvist + + * gwin32.c (get_package_directory_from_module): Don't store + address of local variable in hashtable. + 2001-02-08 Fatih Demir * configure.in: Added "tr" to ALL_LINGUAS. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index fed2109..035040a 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2001-02-10 Tor Lillqvist + + * gwin32.c (get_package_directory_from_module): Don't store + address of local variable in hashtable. + 2001-02-08 Fatih Demir * configure.in: Added "tr" to ALL_LINGUAS. diff --git a/glib/gwin32.c b/glib/gwin32.c index 2a832cd..4730711 100644 --- a/glib/gwin32.c +++ b/glib/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) diff --git a/gwin32.c b/gwin32.c index 2a832cd..4730711 100644 --- 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) -- 2.7.4