Index: glib/gstring.c
===================================================================
RCS file: /cvs/gnome/glib/glib/gstring.c,v
retrieving revision 1.36
diff -u -b -B -p -r1.36 gstring.c
--- glib/gstring.c	31 Mar 2003 22:08:07 -0000	1.36
+++ glib/gstring.c	16 May 2003 20:23:14 -0000
@@ -780,9 +780,10 @@ g_string_append_printf_internal (GString
 				 va_list      args)
 {
   gchar *buffer;
+  gint length;
 
-  buffer = g_strdup_vprintf (fmt, args);
-  g_string_append (string, buffer);
+  buffer = g_strdup_vprintf_len (&length, fmt, args);
+  g_string_append_len (string, buffer, length);
   g_free (buffer);
 }
 
Index: tests/string-test.c
===================================================================
RCS file: /cvs/gnome/glib/tests/string-test.c,v
retrieving revision 1.14
diff -u -b -B -p -r1.14 string-test.c
--- tests/string-test.c	12 Dec 2002 23:52:28 -0000	1.14
+++ tests/string-test.c	16 May 2003 20:23:14 -0000
@@ -208,6 +208,10 @@ main (int   argc,
   g_assert ( memcmp(string1->str, "fiddle\0xyzzy", 13) == 0);
   g_string_insert(string1, 1, "QED");
   g_assert ( memcmp(string1->str, "fQEDiddle\0xyzzy", 16) == 0);
+  g_string_printf (string1, "fiddle%cxyzzy", '\0');
+  g_assert (string1->len == 12);
+  g_assert (memcmp (string1->str, "fiddle\0xyzzy", 13) == 0);
+
   g_string_free (string1, TRUE);
   g_string_free (string2, TRUE);
   
