Browse Source

Fix double format output.

tags/0.8.1
Vsevolod Stakhov 9 years ago
parent
commit
68724d418d
1 changed files with 13 additions and 2 deletions
  1. 13
    2
      src/libutil/printf.c

+ 13
- 2
src/libutil/printf.c View File

@@ -411,8 +411,19 @@ rspamd_vprintf_common (rspamd_printf_append_func func,
case '.':
fmt++;

while (*fmt >= '0' && *fmt <= '9') {
frac_width = frac_width * 10 + *fmt++ - '0';
if (*fmt == '*') {
d = (gint)va_arg (args, gint);
if (G_UNLIKELY (d < 0)) {
msg_err ("critical error: fraction width is less than 0");
return 0;
}
frac_width = (guint)d;
fmt++;
}
else {
while (*fmt >= '0' && *fmt <= '9') {
frac_width = frac_width * 10 + *fmt++ - '0';
}
}

break;

Loading…
Cancel
Save