aboutsummaryrefslogtreecommitdiffstats
path: root/src/printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/printf.c')
-rw-r--r--src/printf.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/printf.c b/src/printf.c
index 00730d16c..b03e1475f 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -296,6 +296,7 @@ rspamd_vsnprintf (gchar *buf, glong max, const gchar *fmt, va_list args)
guint width, sign, hex, humanize, bytes, frac_width, i;
f_str_t *v;
GString *gs;
+ gboolean bv;
if (max <= 0) {
return buf;
@@ -594,6 +595,20 @@ rspamd_vsnprintf (gchar *buf, glong max, const gchar *fmt, va_list args)
continue;
+ case 'b':
+ bv = (gboolean) va_arg (args, double);
+ if (bv) {
+ len = MIN (last - buf, 4);
+ memcpy (buf, "true", len);
+ }
+ else {
+ len = MIN (last - buf, 5);
+ memcpy (buf, "false", len);
+ }
+ fmt++;
+
+ continue;
+
case 'G':
f = (long double) va_arg (args, long double);