summaryrefslogtreecommitdiff
path: root/src/multibyte
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-04-04 14:51:05 -0400
committerRich Felker <dalias@aerifal.cx>2013-04-04 14:51:05 -0400
commitf62b12d051d68aae8bf3c0891f8f809c1fd75e4e (patch)
treef5377637cc9fcb4cd5541e6340710a5760092093 /src/multibyte
parent40b2b5fa94d3ae27293f4d572bdcf1c3a5ef590f (diff)
downloadmusl-f62b12d051d68aae8bf3c0891f8f809c1fd75e4e.tar.gz
musl-f62b12d051d68aae8bf3c0891f8f809c1fd75e4e.tar.bz2
musl-f62b12d051d68aae8bf3c0891f8f809c1fd75e4e.tar.xz
musl-f62b12d051d68aae8bf3c0891f8f809c1fd75e4e.zip
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.
Diffstat (limited to 'src/multibyte')
-rw-r--r--src/multibyte/mbstowcs.c3
1 files changed, 1 insertions, 2 deletions
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);
}