summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/vfprintf.c
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2003-11-05 08:20:45 +0000
committertjr <tjr@FreeBSD.org>2003-11-05 08:20:45 +0000
commit736d21ee30829ad50145dc4f69a99891c824c68f (patch)
treec35ab994daf990dee6de564c4d51c99e38cf895a /lib/libc/stdio/vfprintf.c
parent34fe8a239a2d7322d283dd54a19e4319cd74244f (diff)
downloadFreeBSD-src-736d21ee30829ad50145dc4f69a99891c824c68f.zip
FreeBSD-src-736d21ee30829ad50145dc4f69a99891c824c68f.tar.gz
Pass NULL instead of a pointer to a zeroed mbstate_t object.
Diffstat (limited to 'lib/libc/stdio/vfprintf.c')
-rw-r--r--lib/libc/stdio/vfprintf.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c
index 6125db3..19ce151 100644
--- a/lib/libc/stdio/vfprintf.c
+++ b/lib/libc/stdio/vfprintf.c
@@ -345,18 +345,16 @@ __wcsconv(wchar_t *wcsarg, int prec)
wchar_t *p;
char *convbuf, *mbp;
size_t clen, nbytes;
- mbstate_t mbs;
/*
* Determine the number of bytes to output and allocate space for
* the output.
*/
- memset(&mbs, 0, sizeof(mbs));
if (prec >= 0) {
nbytes = 0;
p = wcsarg;
for (;;) {
- clen = wcrtomb(buf, *p++, &mbs);
+ clen = wcrtomb(buf, *p++, NULL);
if (clen == 0 || clen == (size_t)-1 ||
nbytes + clen > prec)
break;
@@ -364,7 +362,7 @@ __wcsconv(wchar_t *wcsarg, int prec)
}
} else {
p = wcsarg;
- nbytes = wcsrtombs(NULL, (const wchar_t **)&p, 0, &mbs);
+ nbytes = wcsrtombs(NULL, (const wchar_t **)&p, 0, NULL);
if (nbytes == (size_t)-1)
return (NULL);
}
@@ -377,9 +375,8 @@ __wcsconv(wchar_t *wcsarg, int prec)
*/
mbp = convbuf;
p = wcsarg;
- memset(&mbs, 0, sizeof(mbs));
while (mbp - convbuf < nbytes) {
- clen = wcrtomb(mbp, *p++, &mbs);
+ clen = wcrtomb(mbp, *p++, NULL);
if (clen == 0 || clen == (size_t)-1)
break;
mbp += clen;
@@ -795,12 +792,10 @@ reswitch: switch (ch) {
/*FALLTHROUGH*/
case 'c':
if (flags & LONGINT) {
- mbstate_t mbs;
size_t mbseqlen;
- memset(&mbs, 0, sizeof(mbs));
mbseqlen = wcrtomb(cp = buf,
- (wchar_t)GETARG(wint_t), &mbs);
+ (wchar_t)GETARG(wint_t), NULL);
if (mbseqlen == (size_t)-1) {
fp->_flags |= __SERR;
goto error;
OpenPOWER on IntegriCloud