mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
fix wide printf forms ignoring width for %lc format specifier
since the code path for %c was already doing it right, and the logic is identical, condense them into a single case.
This commit is contained in:
parent
b6811019e6
commit
d055e6a45a
1 changed files with 2 additions and 5 deletions
|
@ -258,16 +258,13 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_
|
|||
}
|
||||
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(t=='C' ? arg.i : btowc(arg.i), f);
|
||||
if (w>1 && (fl&LEFT_ADJ)) fprintf(f, "%*s", w-1, "");
|
||||
l = w;
|
||||
continue;
|
||||
case 'C':
|
||||
fputwc(arg.i, f);
|
||||
l = 1;
|
||||
continue;
|
||||
case 'S':
|
||||
a = arg.p;
|
||||
z = a + wcsnlen(a, p<0 ? INT_MAX : p);
|
||||
|
|
Loading…
Add table
Reference in a new issue