if (lim->max_char_count > 0)
{
len = evas_string_char_len_get(current);
- if (len >= lim->max_char_count)
+ newlen = evas_string_char_len_get(utfstr);
+ if ((len >= lim->max_char_count) && (newlen > 0))
{
evas_object_smart_callback_call(entry, "maxlength,reached", NULL);
free(*text);
free(utfstr);
return;
}
- newlen = evas_string_char_len_get(utfstr);
if ((len + newlen) > lim->max_char_count)
_add_chars_till_limit(entry, text, (lim->max_char_count - len), LENGTH_UNIT_CHAR);
}
else if (lim->max_byte_count > 0)
{
len = strlen(current);
- if (len >= lim->max_byte_count)
+ newlen = strlen(utfstr);
+ if ((len >= lim->max_byte_count) && (newlen > 0))
{
evas_object_smart_callback_call(entry, "maxlength,reached", NULL);
free(*text);
free(utfstr);
return;
}
- newlen = strlen(utfstr);
if ((len + newlen) > lim->max_byte_count)
_add_chars_till_limit(entry, text, (lim->max_byte_count - len), LENGTH_UNIT_BYTE);
}