* lib/mbtowc-impl.h (mbtowc): Use mbszero.
* modules/mbtowc (Depends-on): Add mbszero.
+2023-07-16 Bruno Haible <bruno@clisp.org>
+
+ mbtowc: Optimize clearing an mbstate_t.
+ * lib/mbtowc-impl.h (mbtowc): Use mbszero.
+ * modules/mbtowc (Depends-on): Add mbszero.
+
2023-07-16 Bruno Haible <bruno@clisp.org>
mbszero: New module.
wchar_t wc;
size_t result;
- memset (&state, 0, sizeof (mbstate_t));
+ mbszero (&state);
result = mbrtowc (&wc, s, n, &state);
if (result == (size_t)-1 || result == (size_t)-2)
{
Depends-on:
stdlib
-mbrtowc [test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1]
wchar [test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1]
+mbszero [test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1]
+mbrtowc [test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1]
configure.ac:
gl_FUNC_MBTOWC