crt/mingw_pformat: Initialize `mbstate_t` structure properly
When `wcrtomb()` is called with a null wide character (second argument) it is
required to output a sequence of bytes to 'restore the initial shift state'.
For this function, the `mbstate_t` structure shall be initialized before the
call.
Previous code passed an uninitialized structure and expected `wcrtomb(buf,
L'\0', &state)` to initialize `state` to the initial shift state, which was
incorrect.
Signed-off-by: LIU Hao <lh_mouse@126.com>
1 file changed