diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-06 16:51:35 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-06 16:51:35 +0100 |
commit | 8e6bd45485c358e5081e5f49e8376e8098f4a95e (patch) | |
tree | 9a95e4cdd113dec256dbf8379ea4d4996ae87835 /src | |
parent | 66d896e8c819fb25f40fedfbea64f3af7e4a485c (diff) | |
download | rspamd-8e6bd45485c358e5081e5f49e8376e8098f4a95e.tar.gz rspamd-8e6bd45485c358e5081e5f49e8376e8098f4a95e.zip |
Add %T for printing rspamd_ftok_t
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/printf.c | 8 | ||||
-rw-r--r-- | src/libutil/printf.h | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/libutil/printf.c b/src/libutil/printf.c index 7fe7a9c26..9204060b2 100644 --- a/src/libutil/printf.c +++ b/src/libutil/printf.c @@ -338,6 +338,7 @@ rspamd_vprintf_common (rspamd_printf_append_func func, guint64 ui64; guint width, sign, hex, humanize, bytes, frac_width, i; rspamd_fstring_t *v; + rspamd_ftok_t *tok; GString *gs; GError *err; gboolean bv; @@ -457,6 +458,11 @@ rspamd_vprintf_common (rspamd_printf_append_func func, continue; + case 'T': + tok = va_arg (args, rspamd_ftok_t *); + RSPAMD_PRINTF_APPEND (tok->begin, tok->len); + continue; + case 'v': gs = va_arg (args, GString *); RSPAMD_PRINTF_APPEND (gs->str, gs->len); @@ -523,7 +529,7 @@ rspamd_vprintf_common (rspamd_printf_append_func func, sign = 1; break; - case 'T': + case 't': i64 = (gint64) va_arg (args, time_t); sign = 1; break; diff --git a/src/libutil/printf.h b/src/libutil/printf.h index d0db483d9..8cd699212 100644 --- a/src/libutil/printf.h +++ b/src/libutil/printf.h @@ -44,7 +44,8 @@ * %P pid_t * %r rlim_t * %p void * - * %V f_str_t * + * %V rspamd_fstring_t * + * %T rspamd_ftok_t * %v GString * * %s null-terminated string * %xs hex encoded string @@ -52,6 +53,7 @@ * %Z '\0' * %N '\n' * %c gchar + * %t time_t * %e GError * * %% % * |