From 893b6f863a359ad81236990a4f27c38c747f7210 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sat, 5 Jan 2013 22:37:11 +0000 Subject: [PATCH] Added back code to output single char rather than whole string --- src/input_win.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/input_win.c b/src/input_win.c index b53786a9..9292b818 100644 --- a/src/input_win.c +++ b/src/input_win.c @@ -195,14 +195,13 @@ inp_get_char(char *input, int *size) // otherwise just append } else { - char bytes[MB_CUR_MAX]; + char bytes[MB_CUR_MAX+1]; size_t utf_len = wcrtomb(bytes, ch, NULL); for (i = 0 ; i < utf_len; i++) { input[(*size)++] = bytes[i]; } - input[*size] = '\0'; - _inp_clear_no_pad(); - wprintw(inp_win, input); + bytes[utf_len] = '\0'; + wprintw(inp_win, bytes); display_size++;