1
0
mirror of https://github.com/profanity-im/profanity.git synced 2025-01-03 14:57:42 -05:00

Use MB_CUR_MAX when calculating cursor position

This commit is contained in:
James Booth 2015-12-19 23:21:07 +00:00
parent e1f674eca3
commit a02c89a8e8

View File

@ -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)) {