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:
Ilia Maslakov 2011-01-28 21:37:53 +00:00
parent d24d429db9
commit f42e10ab1d

View File

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