summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/vfscanf.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/vfscanf.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/vfscanf.c')
-rw-r--r--lib/libc/stdio/vfscanf.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c
index b6f7571..41bb822 100644
--- a/lib/libc/stdio/vfscanf.c
+++ b/lib/libc/stdio/vfscanf.c
@@ -140,7 +140,6 @@ __svfscanf(FILE *fp, const char *fmt0, va_list ap)
char buf[BUF]; /* buffer for numeric and mb conversions */
wchar_t *wcp; /* handy wide character pointer */
wchar_t *wcp0; /* saves original value of wcp */
- mbstate_t mbs; /* multibyte conversion state */
size_t nconv; /* length of multibyte sequence converted */
/* `basefix' is used to avoid `if' tests in the integer scanner */
@@ -367,8 +366,7 @@ literal:
buf[n++] = *fp->_p;
fp->_p++;
fp->_r--;
- memset(&mbs, 0, sizeof(mbs));
- nconv = mbrtowc(wcp, buf, n, &mbs);
+ nconv = mbrtowc(wcp, buf, n, NULL);
if (nconv == (size_t)-1) {
fp->_flags |= __SERR;
goto input_failure;
@@ -447,8 +445,7 @@ literal:
buf[n++] = *fp->_p;
fp->_p++;
fp->_r--;
- memset(&mbs, 0, sizeof(mbs));
- nconv = mbrtowc(wcp, buf, n, &mbs);
+ nconv = mbrtowc(wcp, buf, n, NULL);
if (nconv == (size_t)-1) {
fp->_flags |= __SERR;
goto input_failure;
@@ -548,8 +545,7 @@ literal:
buf[n++] = *fp->_p;
fp->_p++;
fp->_r--;
- memset(&mbs, 0, sizeof(mbs));
- nconv = mbrtowc(wcp, buf, n, &mbs);
+ nconv = mbrtowc(wcp, buf, n, NULL);
if (nconv == (size_t)-1) {
fp->_flags |= __SERR;
goto input_failure;
OpenPOWER on IntegriCloud