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/vswscanf.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/vswscanf.c')
-rw-r--r-- | lib/libc/stdio/vswscanf.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/libc/stdio/vswscanf.c b/lib/libc/stdio/vswscanf.c index a5f0a89..128e1a4 100644 --- a/lib/libc/stdio/vswscanf.c +++ b/lib/libc/stdio/vswscanf.c @@ -65,7 +65,6 @@ vswscanf(const wchar_t * __restrict str, const wchar_t * __restrict fmt, va_list ap) { FILE f; - mbstate_t mbs; struct __sFILEX ext; char *mbstr; size_t mlen; @@ -77,8 +76,7 @@ vswscanf(const wchar_t * __restrict str, const wchar_t * __restrict fmt, */ if ((mbstr = malloc(wcslen(str) * MB_CUR_MAX + 1)) == NULL) return (EOF); - memset(&mbs, 0, sizeof(mbs)); - if ((mlen = wcsrtombs(mbstr, &str, SIZE_T_MAX, &mbs)) == (size_t)-1) { + if ((mlen = wcsrtombs(mbstr, &str, SIZE_T_MAX, NULL)) == (size_t)-1) { free(mbstr); return (EOF); } |