From: Vsevolod Stakhov Date: Wed, 15 Oct 2014 12:23:39 +0000 (+0100) Subject: Implement va_list version for gstring printf. X-Git-Tag: 0.7.2~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9710cbb0853e4a0841e542e90c29e6e556aeed04;p=thirdparty%2Frspamd.git Implement va_list version for gstring printf. --- diff --git a/src/libutil/printf.c b/src/libutil/printf.c index 98c8969349..772a687454 100644 --- a/src/libutil/printf.c +++ b/src/libutil/printf.c @@ -293,12 +293,18 @@ rspamd_printf_gstring (GString *s, const gchar *fmt, ...) glong r; va_start (args, fmt); - r = rspamd_vprintf_common (rspamd_printf_append_gstring, s, fmt, args); + r = rspamd_vprintf_gstring (s, fmt, args); va_end (args); return r; } +glong +rspamd_vprintf_gstring (GString *s, const gchar *fmt, va_list args) +{ + return rspamd_vprintf_common (rspamd_printf_append_gstring, s, fmt, args); +} + #define RSPAMD_PRINTF_APPEND(buf, len) \ do { \ RSPAMD_PRINTF_APPEND_BUF(buf, len); \ diff --git a/src/libutil/printf.h b/src/libutil/printf.h index 34df20a76b..2bc421143e 100644 --- a/src/libutil/printf.h +++ b/src/libutil/printf.h @@ -73,6 +73,7 @@ glong rspamd_snprintf (gchar *buf, glong max, const gchar *fmt, ...); gchar * rspamd_vsnprintf (gchar *buf, glong max, const gchar *fmt, va_list args); glong rspamd_printf_gstring (GString *s, const gchar *fmt, ...); +glong rspamd_vprintf_gstring (GString *s, const gchar *fmt, va_list args); glong rspamd_vprintf_common (rspamd_printf_append_func func, gpointer apd,