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:
f0b85fd
)
fix uninitialized var in vfwprintf printing 0-prec string
author
Rich Felker
<dalias@aerifal.cx>
Fri, 4 May 2012 05:26:43 +0000
(
01:26
-0400)
committer
Rich Felker
<dalias@aerifal.cx>
Fri, 4 May 2012 05:26:43 +0000
(
01:26
-0400)
this could lead to spurious failures of wide printf functions
src/stdio/vfwprintf.c
patch
|
blob
|
history
diff --git
a/src/stdio/vfwprintf.c
b/src/stdio/vfwprintf.c
index 42ce304fb053e5fc2a6c466a236bb7dbc1459ab9..62829806b10386a908296b3bef602bc49ac50f15 100644
(file)
--- a/
src/stdio/vfwprintf.c
+++ b/
src/stdio/vfwprintf.c
@@
-292,7
+292,7
@@
static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_
case 's':
bs = arg.p;
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;
p=l;
if (w<p) w=p;