projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d41cdef
)
vfwprintf: honor field width with 'c' format type
author
A. Wilcox
<AWilcox@Wilcox-Tech.com>
Thu, 23 Aug 2018 13:06:12 +0000
(08:06 -0500)
committer
Rich Felker
<dalias@aerifal.cx>
Wed, 29 Aug 2018 01:31:05 +0000
(21:31 -0400)
src/stdio/vfwprintf.c
patch
|
blob
|
history
diff --git
a/src/stdio/vfwprintf.c
b/src/stdio/vfwprintf.c
index e87ad42a02b3bca59665cf08e00ae88e6c8695ef..9d774fccbf553d41c1f5306fb3766e0d4e4c3aae 100644
(file)
--- a/
src/stdio/vfwprintf.c
+++ b/
src/stdio/vfwprintf.c
@@
-255,8
+255,11
@@
static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_
}
continue;
case 'c':
+ if (w<1) w=1;
+ if (w>1 && !(fl&LEFT_ADJ)) fprintf(f, "%*s", w-1, "");
fputwc(btowc(arg.i), f);
- l = 1;
+ if (w>1 && (fl&LEFT_ADJ)) fprintf(f, "%*s", w-1, "");
+ l = w;
continue;
case 'C':
fputwc(arg.i, f);