mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-26 21:22:03 +03:00
Ticket #2484 (segfault after getting previous char)
fixed segfault after getting the previous char in utf8, if previous char's are: 0xB1, 0xB3, 0xB6, 0xBF, 0xBC. Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
This commit is contained in:
parent
d24d429db9
commit
f42e10ab1d
@ -1872,7 +1872,13 @@ edit_get_prev_utf (WEdit * edit, long byte_index, int *char_width)
|
||||
if (str != buf)
|
||||
str = g_utf8_find_prev_char (buf, str);
|
||||
|
||||
res = g_utf8_get_char_validated (str, -1);
|
||||
if (res < 0 || str == NULL)
|
||||
{
|
||||
*char_width = 0;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
res = g_utf8_get_char_validated (str, -1);
|
||||
|
||||
if (res < 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user