diff options
author | Rich Felker <dalias@aerifal.cx> | 2023-03-20 13:48:50 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2023-03-20 13:48:50 -0400 |
commit | d055e6a45a17673b8dd3ec16e786bb2fe1700dd5 (patch) | |
tree | 1452f24f43ecddfa709af92097bab3cadca7086f /src | |
parent | b6811019e62a7561a4922f90e54b30ac306efe0b (diff) | |
download | musl-d055e6a45a17673b8dd3ec16e786bb2fe1700dd5.tar.gz musl-d055e6a45a17673b8dd3ec16e786bb2fe1700dd5.tar.bz2 musl-d055e6a45a17673b8dd3ec16e786bb2fe1700dd5.tar.xz musl-d055e6a45a17673b8dd3ec16e786bb2fe1700dd5.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/stdio/vfwprintf.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/stdio/vfwprintf.c b/src/stdio/vfwprintf.c index 85b036c3..e69a2d5e 100644 --- a/src/stdio/vfwprintf.c +++ b/src/stdio/vfwprintf.c @@ -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); |