From: Rich Felker Date: Thu, 4 Apr 2013 18:51:05 +0000 (-0400) Subject: minor optimization to mbstowcs X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=commitdiff_plain;h=f62b12d051d68aae8bf3c0891f8f809c1fd75e4e minor optimization to mbstowcs there is no need to zero-fill an mbstate_t object in the caller; mbsrtowcs will automatically treat a null pointer as the initial state. --- diff --git a/src/multibyte/mbstowcs.c b/src/multibyte/mbstowcs.c index 5071baf7..8e3fac15 100644 --- a/src/multibyte/mbstowcs.c +++ b/src/multibyte/mbstowcs.c @@ -13,6 +13,5 @@ size_t mbstowcs(wchar_t *restrict ws, const char *restrict s, size_t wn) { - mbstate_t st = { 0 }; - return mbsrtowcs(ws, (void*)&s, wn, &st); + return mbsrtowcs(ws, (void*)&s, wn, 0); }