Always include +1 for the size. 0*2 == 0, so malloc returns NULL, which is

2001-01-29  Not Zed  <NotZed@Ximian.com>

        * gal/widgets/e-unicode.c (e_utf8_xml1_decode): Always include +1
        for the size.  0*2 == 0, so malloc returns NULL, which is not what
        we want.

svn path=/trunk/; revision=7885
This commit is contained in:
Not Zed
2001-01-29 09:15:03 +00:00
committed by Michael Zucci
parent a5edc8ab73
commit 1b18f022ca

View File

@ -481,7 +481,7 @@ e_utf8_xml1_decode (const gchar *text)
g_return_val_if_fail (text != NULL, NULL);
len = strlen (text);
len = strlen (text)+1;
/* len * 2 is absolute maximum */
u = d = g_malloc (len * 2);