ecore_imf/wayland: fix infinite loop bug when ibus-hangul is used

When korean language was typed with ibus-hangul,
wayland immodule falled into the infinite loop.
This commit is contained in:
Jihoon Kim 2014-10-08 14:24:14 +09:00
parent 93b865767f
commit d56c2654f3
1 changed files with 8 additions and 0 deletions

View File

@ -82,6 +82,14 @@ 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);