summaryrefslogtreecommitdiff
path: root/glib
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2005-03-23 14:53:35 +0000
committerTor Lillqvist <tml@src.gnome.org>2005-03-23 14:53:35 +0000
commit6e51f47e137031e7caa561724d786f48e24970a1 (patch)
tree42a6805b2d380b809dcd4ac873af32a4527effac /glib
parent4635159309f4aadfec200bf34e1d8113a2c7348c (diff)
downloadglib-6e51f47e137031e7caa561724d786f48e24970a1.tar.gz
[Win32] Fix corner case bug when environment variable value is exactly one
2005-03-23 Tor Lillqvist <tml@novell.com> * glib/gutils.c (g_getenv): [Win32] Fix corner case bug when environment variable value is exactly one character.
Diffstat (limited to 'glib')
-rw-r--r--glib/gutils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/glib/gutils.c b/glib/gutils.c
index b07a95aee..4ad499570 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -1009,6 +1009,8 @@ g_getenv (const gchar *variable)
g_free (wname);
return NULL;
}
+ else if (len == 1)
+ len = 2;
wvalue = g_new (wchar_t, len);
@@ -1060,6 +1062,8 @@ g_getenv (const gchar *variable)
g_free (cpname);
return NULL;
}
+ else if (len == 1)
+ len = 2;
cpvalue = g_new (gchar, len);