Patch by Patryk Kaczmarek <patryk.k@samsung.com>
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@78215
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
*
* @param buf the string
* @param iindex the index to look at and return by.
- * @return the codepoint found.
+ * @return the codepoint found, 0 if @p buf or @p iindex are NULL
* @since 1.1.0
*/
EAPI Eina_Unicode eina_unicode_utf8_get_prev(const char *buf, int *iindex) EINA_ARG_NONNULL(1, 2);
EAPI Eina_Unicode
eina_unicode_utf8_get_next(const char *buf, int *iindex)
{
- int ind = *iindex;
+ int ind;
Eina_Unicode r;
unsigned char d;
EINA_SAFETY_ON_NULL_RETURN_VAL(buf, 0);
EINA_SAFETY_ON_NULL_RETURN_VAL(iindex, 0);
+ ind = *iindex;
+
/* if this char is the null terminator, exit */
if ((d = buf[ind++]) == 0) return 0;