From ad2eb8877b0eecc972788732a7da8f596bcc6a52 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Tue, 14 Apr 2009 15:56:46 +0300 Subject: [PATCH] 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 --- src/strutil.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/strutil.c b/src/strutil.c index 997c25573..4dc3a154f 100644 --- a/src/strutil.c +++ b/src/strutil.c @@ -252,9 +252,17 @@ str_vfs_convert_to (GIConv coder, const char *string, int size, void str_printf (GString * buffer, const char *format, ...) { + gchar *tmp; va_list ap; 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); }