diff options
Diffstat (limited to 'lib/libc/string/wcsxfrm.c')
-rw-r--r-- | lib/libc/string/wcsxfrm.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/libc/string/wcsxfrm.c b/lib/libc/string/wcsxfrm.c index 4be6e46..4e988af 100644 --- a/lib/libc/string/wcsxfrm.c +++ b/lib/libc/string/wcsxfrm.c @@ -97,19 +97,16 @@ wcsxfrm(wchar_t * __restrict dest, const wchar_t * __restrict src, size_t len) 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); } |