forked from enlightenment/efl
ecore_imf/wayland: Use simple code to fix infinite loop bug related to ibus-hangul
This commit is contained in:
parent
73a23401ef
commit
83d57bc6f8
|
@ -82,17 +82,12 @@ utf8_offset_to_characters(const char *str, int offset)
|
|||
{
|
||||
int index = 0;
|
||||
unsigned int i = 0;
|
||||
int len = 0;
|
||||
|
||||
if (!str) return 0;
|
||||
|
||||
len = strlen(str);
|
||||
|
||||
if (offset > len)
|
||||
offset = len;
|
||||
|
||||
for (; index < offset; i++)
|
||||
eina_unicode_utf8_next_get(str, &index);
|
||||
{
|
||||
if (eina_unicode_utf8_next_get(str, &index) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue