while (*s) len += (*s++ & 0xc0) != 0x80;
preedit_attr = (ime_preedit_attribute *)calloc(1, sizeof(ime_preedit_attribute));
- preedit_attr->start = 0;
- preedit_attr->length = len;
- preedit_attr->type = IME_ATTR_FONTSTYLE;
- preedit_attr->value = IME_ATTR_FONTSTYLE_UNDERLINE;
- attr_list = eina_list_append(attr_list, (void *)preedit_attr);
+ if (preedit_attr) {
+ preedit_attr->start = 0;
+ preedit_attr->length = len;
+ preedit_attr->type = IME_ATTR_FONTSTYLE;
+ preedit_attr->value = IME_ATTR_FONTSTYLE_UNDERLINE;
+ attr_list = eina_list_append(attr_list, (void *)preedit_attr);
+ }
ime_update_preedit_string(str, attr_list);
} else {