提交 f62b12d0 编写于 作者: R Rich Felker

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.
上级 40b2b5fa
...@@ -13,6 +13,5 @@ ...@@ -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);
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册