#if defined(METRIC_CACHE) || defined(WORD_CACHE)
unsigned int len;
- /* A fast strNlen would be nice (there is a wcsnlen strangely) */
- len = eina_unicode_strnlen(text,WORD_CACHE_MAXLEN);
+ len = text_props->text_len;
if (len > 2 && (len < WORD_CACHE_MAXLEN))
{
/* Skip common chars */
const Eina_Unicode *tmp;
for (tmp = text ;
- *tmp &&
+ ((size_t) (tmp - text) < text_props->text_len) &&
evas_common_language_char_script_get(*tmp) ==
EVAS_SCRIPT_COMMON ;
tmp++)
;
- if (!*tmp && (tmp > text)) tmp--;
+ if (((size_t) (tmp - text) == text_props->text_len) && (tmp > text))
+ tmp--;
evas_common_font_glyph_search(fn, &fi, *tmp);
}
/* Skip common chars */
const Eina_Unicode *tmp;
for (tmp = text ;
- *tmp &&
+ ((tmp - text) < len) &&
evas_common_language_char_script_get(*tmp) ==
EVAS_SCRIPT_COMMON ;
tmp++)
;
- if (!*tmp && (tmp > text)) tmp--;
+ if (((tmp - text) == len) && (tmp > text)) tmp--;
evas_common_font_glyph_search(fn, &fi, *tmp);
}