diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-05-04 01:26:43 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-05-04 01:26:43 -0400 |
commit | db4096c5f2ffb15e52015004ab5a900b820c6683 (patch) | |
tree | df19e94e1daa9e549f39ebb15f27c230c916703f /src/stdio/vfwprintf.c | |
parent | f0b85fd926c5a381416c94be62e7bc20d9fdbdb1 (diff) | |
download | musl-db4096c5f2ffb15e52015004ab5a900b820c6683.tar.gz musl-db4096c5f2ffb15e52015004ab5a900b820c6683.tar.bz2 musl-db4096c5f2ffb15e52015004ab5a900b820c6683.tar.xz musl-db4096c5f2ffb15e52015004ab5a900b820c6683.zip |
fix uninitialized var in vfwprintf printing 0-prec string
this could lead to spurious failures of wide printf functions
Diffstat (limited to 'src/stdio/vfwprintf.c')
-rw-r--r-- | src/stdio/vfwprintf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdio/vfwprintf.c b/src/stdio/vfwprintf.c index 42ce304f..62829806 100644 --- 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; |