From a02c89a8e8f6abe8935f6cf95e0b016d1ac40a34 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sat, 19 Dec 2015 23:21:07 +0000 Subject: [PATCH] Use MB_CUR_MAX when calculating cursor position --- src/ui/inputwin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c index a6711bab..d5643f76 100644 --- a/src/ui/inputwin.c +++ b/src/ui/inputwin.c @@ -311,7 +311,7 @@ _inp_offset_to_col(char *str, int offset) while (i < offset && str[i] != '\0') { gunichar uni = g_utf8_get_char(&str[i]); - size_t ch_len = mbrlen(&str[i], 4, NULL); + size_t ch_len = mbrlen(&str[i], MB_CUR_MAX, NULL); i += ch_len; col++; if (g_unichar_iswide(uni)) {