X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fstdio%2Fvfprintf.c;h=f13fbe10576d157684ecfc9d4e8bcf448010cd6d;hp=a8cf41b666c9520fc407ca810fd260d9693dd7f4;hb=e8dbf00a789e3b56ca6c3d88e8048b7b2c18b797;hpb=2f3d02cd83a46244c3f5a6fec851d7eded1376f4 diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index a8cf41b6..f13fbe10 100644 --- a/src/stdio/vfprintf.c +++ b/src/stdio/vfprintf.c @@ -326,13 +326,15 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t) if (x || d+1!=z) { long double round = CONCAT(0x1p,LDBL_MANT_DIG); long double small; - if (x 999999999) { *d--=0; (*d)++; @@ -341,6 +343,7 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t) for (i=10, e=9*(r-a); *a>=i; i*=10, e++); } } + if (z>d+1) z=d+1; for (; !z[-1] && z>a; z--); }