mirror of
https://github.com/MidnightCommander/mc
synced 2025-03-07 00:21:28 +03:00
src/strutil.c (str_printf): use g_string_append_vprintf() function if available.
This commit is contained in:
parent
6568cad9df
commit
438e95b110
@ -252,17 +252,18 @@ 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);
|
||||
/*
|
||||
* 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);
|
||||
#if GLIB_CHECK_VERSION (2, 14, 0)
|
||||
g_string_append_vprintf (buffer, format, ap);
|
||||
#else
|
||||
{
|
||||
gchar *tmp;
|
||||
tmp = g_strdup_vprintf (format, ap);
|
||||
g_string_append (buffer, tmp);
|
||||
g_free(tmp);
|
||||
}
|
||||
#endif
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user