libc/libvsprintf:fix vsnprintf bug with "%#.0f"
With double value=3.141593 initialized in va_list ap, such code: vsnprintf(buffer, sizeof(buffer), "%#.0f", ap); expected output string: "3." but real output string: ".3" Signed-off-by: Sunny <zxcvbnm37425@gmail.com>
This commit is contained in:
parent
6b11672310
commit
abfdffd879
|
@ -816,11 +816,6 @@ flt_oper:
|
|||
|
||||
if (--n < -prec)
|
||||
{
|
||||
if ((flags & FL_ALT) != 0 && n == -1)
|
||||
{
|
||||
stream_putc('.', stream);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -835,6 +830,11 @@ flt_oper:
|
|||
}
|
||||
|
||||
stream_putc(out, stream);
|
||||
|
||||
if ((flags & FL_ALT) != 0 && n == -1)
|
||||
{
|
||||
stream_putc('.', stream);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue