eina: Actually implement strnlen for eina_unicode.

SVN revision: 50700
This commit is contained in:
Brett Nash 2010-07-31 03:54:09 +00:00
parent e48c3cdc31
commit db89ba43d7
1 changed files with 2 additions and 1 deletions

View File

@ -95,7 +95,8 @@ EAPI size_t
eina_unicode_strnlen(const Eina_Unicode *ustr, int n)
{
const Eina_Unicode *end;
for (end = ustr; *end; end++)
const Eina_Unicode *last = ustr + n; /* technically not portable ;-) */
for (end = ustr; *end && last < end; end++)
;
return end - ustr;
}