From 63d40196b91df8937424cfa4495e8991c5a20827 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 8 Jun 2012 10:36:43 -0400 Subject: fix %ls breakage in last printf fix signedness issue kept %ls with no precision from working at all --- src/stdio/vfprintf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- cgit v1.2.3-70-g09d2