src/strutil.c: replace call of g_string_append_vprintf() with g_strdup_vprintf and g_string_append

Not all versions of glib2 have function g_string_append_vprintf
This commit is contained in:
Slava Zanko 2009-04-14 15:56:46 +03:00
parent ca7427cd35
commit ad2eb8877b

View File

@ -252,9 +252,17 @@ str_vfs_convert_to (GIConv coder, const char *string, int size,
void void
str_printf (GString * buffer, const char *format, ...) str_printf (GString * buffer, const char *format, ...)
{ {
gchar *tmp;
va_list ap; va_list ap;
va_start (ap, format); va_start (ap, format);
g_string_append_vprintf (buffer, format, ap); /*
* more simple call:
g_string_append_vprintf (buffer, format, ap);
* but not all versions of glib2 have this function :(
*/
tmp = g_strdup_vprintf ( format, ap);
g_string_append (buffer, tmp);
g_free(tmp);
va_end (ap); va_end (ap);
} }