Corrected variable types and in _valid_character_check() function
and optimized number of strlen() calls in the function
Change-Id: I98dd720ea5d650bd5ffdec348cacfc04b1653423
(cherry picked from commit
64f63a98999e22641f1940c0d519af78ee1937c9)
static Eina_Bool _valid_character_check(char *text, const char *check_buf)
{
DEBUG("START");
- int i = 0;
- int j = 0;
+
if (!text)
return EINA_FALSE;
- for (i = 0; i < strlen(check_buf); i++)
- for (j = 0; j < strlen(text); j++)
+
+ size_t check_buf_len = strlen(check_buf);
+ size_t text_len = strlen(text);
+
+ for (size_t i = 0; i < check_buf_len; i++)
+ for (size_t j = 0; j < text_len; j++)
if (text[j] == check_buf[i])
return EINA_FALSE;
DEBUG("END");