Correctly use g_printf_string_upper_bound in g_string_append_vprintf.

2007-06-16  Mathias Hasselmann  <mathias.hasselmann@gmx.de>

	* glib/gstring.c: Correctly use g_printf_string_upper_bound
	in g_string_append_vprintf. Fixes #447933.


svn path=/trunk/; revision=5570
This commit is contained in:
Mathias Hasselmann 2007-06-16 12:04:25 +00:00 committed by Mathias Hasselmann
parent 41294a7468
commit 506fd2d2e1
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2007-06-16 Mathias Hasselmann <mathias.hasselmann@gmx.de>
* glib/gstring.c: Correctly use g_printf_string_upper_bound
in g_string_append_vprintf. Fixes #447933.
2007-06-15 Sebastian Wilhelmi <wilhelmi@google.com>
* docs/reference/glib/tmpl/threads.sgml: Extended the comments on

View File

@ -1278,12 +1278,16 @@ g_string_append_vprintf (GString *string,
const gchar *fmt,
va_list args)
{
va_list sneak;
gsize length;
g_return_if_fail (string != NULL);
g_return_if_fail (fmt != NULL);
length = g_printf_string_upper_bound (fmt, args);
G_VA_COPY (sneak, args);
length = g_printf_string_upper_bound (fmt, sneak);
va_end (sneak);
g_string_maybe_expand (string, length);
length = g_vsnprintf (string->str + string->len, length, fmt, args);
string->len += length;