diff options
author | tjr <tjr@FreeBSD.org> | 2003-11-05 08:20:45 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2003-11-05 08:20:45 +0000 |
commit | 736d21ee30829ad50145dc4f69a99891c824c68f (patch) | |
tree | c35ab994daf990dee6de564c4d51c99e38cf895a /lib/libc/stdio/vfscanf.c | |
parent | 34fe8a239a2d7322d283dd54a19e4319cd74244f (diff) | |
download | FreeBSD-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.c | 10 |
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; |