提交 9cdaf1a8 编写于 作者: A A. Wilcox 提交者: Rich Felker

vfwprintf: honor field width with 'c' format type

上级 d41cdef9
...@@ -255,8 +255,11 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ ...@@ -255,8 +255,11 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_
} }
continue; continue;
case 'c': case 'c':
if (w<1) w=1;
if (w>1 && !(fl&LEFT_ADJ)) fprintf(f, "%*s", w-1, "");
fputwc(btowc(arg.i), f); fputwc(btowc(arg.i), f);
l = 1; if (w>1 && (fl&LEFT_ADJ)) fprintf(f, "%*s", w-1, "");
l = w;
continue; continue;
case 'C': case 'C':
fputwc(arg.i, f); fputwc(arg.i, f);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册