提交 63d40196 编写于 作者: R Rich Felker

fix %ls breakage in last printf fix

signedness issue kept %ls with no precision from working at all
上级 6e9ff6a4
......@@ -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<p && *ws && (l=wctomb(mb, *ws++))>=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 && *ws && i+(l=wctomb(mb, *ws++))<=p; i+=l)
for (i=0; i<0U+p && *ws && i+(l=wctomb(mb, *ws++))<=p; i+=l)
out(f, mb, l);
pad(f, ' ', w, p, fl^LEFT_ADJ);
l = w>p ? w : p;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册