提交 db4096c5 编写于 作者: R Rich Felker

fix uninitialized var in vfwprintf printing 0-prec string

this could lead to spurious failures of wide printf functions
上级 f0b85fd9
...@@ -292,7 +292,7 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ ...@@ -292,7 +292,7 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_
case 's': case 's':
bs = arg.p; bs = arg.p;
if (p<0) p = INT_MAX; if (p<0) p = INT_MAX;
for (l=0; l<p && (i=mbtowc(&wc, bs, MB_LEN_MAX))>0; bs+=i, l++); for (i=l=0; l<p && (i=mbtowc(&wc, bs, MB_LEN_MAX))>0; bs+=i, l++);
if (i<0) return -1; if (i<0) return -1;
p=l; p=l;
if (w<p) w=p; if (w<p) w=p;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册