about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/input_win.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/input_win.c b/src/input_win.c
index b731b978..0d79fd5c 100644
--- a/src/input_win.c
+++ b/src/input_win.c
@@ -188,8 +188,10 @@ inp_get_char(char *input, int *size)
 
             // otherwise just append
             } else {
+                mbstate_t state;
+                memset(&state, '\0', sizeof (state));
                 char bytes[5];
-                size_t utf_len = wcrtomb(bytes, ch, NULL);
+                size_t utf_len = wcrtomb(bytes, ch, &state);
                 int i;
                 for (i = 0 ; i < utf_len; i++) {
                     input[(*size)++] = bytes[i];