projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
40b2b5f
)
minor optimization to mbstowcs
author
Rich Felker
<dalias@aerifal.cx>
Thu, 4 Apr 2013 18:51:05 +0000
(14:51 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Thu, 4 Apr 2013 18:51:05 +0000
(14:51 -0400)
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.
src/multibyte/mbstowcs.c
patch
|
blob
|
history
diff --git
a/src/multibyte/mbstowcs.c
b/src/multibyte/mbstowcs.c
index 5071baf7aab06cc9fba5de494cf4ee0a2c402892..8e3fac154abe57a2f4543606cf3d06ce36cca728 100644
(file)
--- 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);
}