diff options
author | tjr <tjr@FreeBSD.org> | 2003-11-05 08:07:00 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2003-11-05 08:07:00 +0000 |
commit | 34fe8a239a2d7322d283dd54a19e4319cd74244f (patch) | |
tree | 107cd87f7fdae692a53bf308e45e1f7b4e731e29 /lib/libc/string/wcscoll.c | |
parent | bd6d8c9eef2f713508ab546bae8be8a34a8a1c26 (diff) | |
download | FreeBSD-src-34fe8a239a2d7322d283dd54a19e4319cd74244f.zip FreeBSD-src-34fe8a239a2d7322d283dd54a19e4319cd74244f.tar.gz |
Pass NULL instead of a pointer to a zeroed mbstate_t object.
Diffstat (limited to 'lib/libc/string/wcscoll.c')
-rw-r--r-- | lib/libc/string/wcscoll.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/libc/string/wcscoll.c b/lib/libc/string/wcscoll.c index 79dad7d..b042a25 100644 --- a/lib/libc/string/wcscoll.c +++ b/lib/libc/string/wcscoll.c @@ -79,19 +79,16 @@ wcscoll(const wchar_t *ws1, const wchar_t *ws2) static char * __mbsdup(const wchar_t *ws) { - mbstate_t state; const wchar_t *wcp; size_t len; char *mbs; - memset(&state, 0, sizeof(state)); wcp = ws; - if ((len = wcsrtombs(NULL, &wcp, 0, &state)) == (size_t)-1) + if ((len = wcsrtombs(NULL, &wcp, 0, NULL)) == (size_t)-1) return (NULL); if ((mbs = malloc(len + 1)) == NULL) return (NULL); - memset(&state, 0, sizeof(state)); - wcsrtombs(mbs, &ws, len + 1, &state); + wcsrtombs(mbs, &ws, len + 1, NULL); return (mbs); } |