mirror of
https://github.com/fluencelabs/musl
synced 2025-06-28 14:11:56 +00:00
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.
This commit is contained in:
@ -13,6 +13,5 @@
|
|||||||
|
|
||||||
size_t mbstowcs(wchar_t *restrict ws, const char *restrict s, size_t wn)
|
size_t mbstowcs(wchar_t *restrict ws, const char *restrict s, size_t wn)
|
||||||
{
|
{
|
||||||
mbstate_t st = { 0 };
|
return mbsrtowcs(ws, (void*)&s, wn, 0);
|
||||||
return mbsrtowcs(ws, (void*)&s, wn, &st);
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user