Ver código fonte

Fix double format output.

tags/0.8.1
Vsevolod Stakhov 9 anos atrás
pai
commit
68724d418d
1 arquivos alterados com 13 adições e 2 exclusões
  1. 13
    2
      src/libutil/printf.c

+ 13
- 2
src/libutil/printf.c Ver arquivo

@@ -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;

Carregando…
Cancelar
Salvar