X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Fvfprintf.c;h=a3bf18dd8c6d4f4b1ef0702239664b74ca33e874;hb=82a4499e671db62fab1e3928de6e00bb109d4c8d;hp=d593b3302ad0ec3b88e62156be9c290814b20b2c;hpb=6e9ff6a4cf4c6ab8f18e35934e33579c4caf2c3e;p=musl diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index d593b330..a3bf18dd 100644 --- a/src/stdio/vfprintf.c +++ b/src/stdio/vfprintf.c @@ -296,7 +296,7 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t) e2-=sh; } while (e2<0) { - uint32_t carry=0, *z2; + uint32_t carry=0, *b; int sh=MIN(9,-e2); for (d=a; d 2+p/9) z = b+2+p/9; e2+=sh; } @@ -599,12 +599,12 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, p = -1; case 'S': ws = arg.p; - for (i=l=0; i

=0 && l<=0U+p-i; i+=l); + for (i=l=0; i<0U+p && *ws && (l=wctomb(mb, *ws++))>=0 && l<=0U+p-i; i+=l); if (l<0) return -1; p = i; pad(f, ' ', w, p, fl); ws = arg.p; - for (i=0; i

p ? w : p;