about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-12-19 23:21:07 +0000
committerJames Booth <boothj5@gmail.com>2015-12-19 23:21:07 +0000
commita02c89a8e8f6abe8935f6cf95e0b016d1ac40a34 (patch)
treed44d21f50e57fcfb95623c2113a1080c4e34b290
parente1f674eca39d5e8e7561753a30c417fd1b9a1488 (diff)
downloadprofani-tty-a02c89a8e8f6abe8935f6cf95e0b016d1ac40a34.tar.gz
Use MB_CUR_MAX when calculating cursor position
-rw-r--r--src/ui/inputwin.c2
1 files changed, 1 insertions, 1 deletions
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)) {