crt/stdio: Fix `%.d` output of printf128 for 0
When `%.d` is passed an argument of 0, it should not produce any digits. The
printf128 path uses an intermediate numeric string, which, in this case,
shall be truncated to an empty string. Old code left least one digit so it
erroneously produced "0".
This error was observed in one test in MPFR.
Signed-off-by: LIU Hao <lh_mouse@126.com>
diff --git a/mingw-w64-crt/stdio/mingw_pformat.c b/mingw-w64-crt/stdio/mingw_pformat.c
index 317dfe9..fc7429b 100644
--- a/mingw-w64-crt/stdio/mingw_pformat.c
+++ b/mingw-w64-crt/stdio/mingw_pformat.c
@@ -775,7 +775,7 @@
*/
__bigint_to_string(value.__pformat_u128_t.t128_2.digits32,
4, tmp_buff, bufflen);
- __bigint_trim_leading_zeroes(tmp_buff,1);
+ __bigint_trim_leading_zeroes(tmp_buff, 0);
memset(p,0,bufflen);
for(int32_t i = strlen(tmp_buff) - 1; i >= 0; i--){