From: Rich Felker Date: Fri, 8 Jun 2012 14:36:43 +0000 (-0400) Subject: fix %ls breakage in last printf fix X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=63d40196b91df8937424cfa4495e8991c5a20827;hp=6e9ff6a4cf4c6ab8f18e35934e33579c4caf2c3e;p=musl fix %ls breakage in last printf fix signedness issue kept %ls with no precision from working at all --- diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index d593b330..481436df 100644 --- a/src/stdio/vfprintf.c +++ b/src/stdio/vfprintf.c @@ -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;