diff options
Diffstat (limited to 'src/multibyte/c16rtomb.c')
-rw-r--r-- | src/multibyte/c16rtomb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/multibyte/c16rtomb.c b/src/multibyte/c16rtomb.c index 2e8ec970..39ca3758 100644 --- a/src/multibyte/c16rtomb.c +++ b/src/multibyte/c16rtomb.c @@ -4,6 +4,8 @@ size_t c16rtomb(char *restrict s, char16_t c16, mbstate_t *restrict ps) { + static unsigned internal_state; + if (!ps) ps = (void *)&internal_state; unsigned *x = (unsigned *)ps; wchar_t wc; |