From 9710cbb0853e4a0841e542e90c29e6e556aeed04 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 15 Oct 2014 13:23:39 +0100 Subject: [PATCH] Implement va_list version for gstring printf. --- src/libutil/printf.c | 8 +++++++- src/libutil/printf.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libutil/printf.c b/src/libutil/printf.c index 98c896934..772a68745 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 34df20a76..2bc421143 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, -- 2.39.5