diff options
Diffstat (limited to 'src/fe-text/term-terminfo.c')
-rw-r--r-- | src/fe-text/term-terminfo.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/fe-text/term-terminfo.c b/src/fe-text/term-terminfo.c index 21591889..5552d9cb 100644 --- a/src/fe-text/term-terminfo.c +++ b/src/fe-text/term-terminfo.c @@ -556,13 +556,12 @@ static int input_utf8(const unsigned char *buffer, int size, unichar *result) { const unsigned char *end = buffer; - *result = get_utf8_char(&end, size); - switch (*result) { - case (unichar) -2: + switch (get_utf8_char(&end, size, result)) { + case -2: /* not UTF8 - fallback to 8bit ascii */ *result = *buffer; return 1; - case (unichar) -1: + case -1: /* need more data */ return -1; default: |