about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-01-04 00:48:12 +0000
committerJames Booth <boothj5@gmail.com>2013-01-04 00:48:12 +0000
commit516ba1662703a3d313f89b9a7df3689773c5dde7 (patch)
tree1b753d436f3c253a8ad2735f91bbc95a4f0c90fc
parent57f9e43566769cd76dea14c52f07cc5789eb22db (diff)
downloadprofani-tty-516ba1662703a3d313f89b9a7df3689773c5dde7.tar.gz
Added mbstate_t
-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];