From 7a132e9c086dc5c6b3aafe83d878e74aad041291 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Fri, 19 Oct 2012 01:51:07 +0000 Subject: [PATCH] efl: backport r78215. SVN revision: 78217 --- src/lib/eina/eina_unicode.c | 4 +++- src/lib/eina/eina_unicode.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/eina/eina_unicode.c b/src/lib/eina/eina_unicode.c index 75059069c6..a1993de697 100644 --- a/src/lib/eina/eina_unicode.c +++ b/src/lib/eina/eina_unicode.c @@ -193,13 +193,15 @@ eina_unicode_escape(const Eina_Unicode *str) 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; diff --git a/src/lib/eina/eina_unicode.h b/src/lib/eina/eina_unicode.h index 1b3ed15766..705ec7ba02 100644 --- a/src/lib/eina/eina_unicode.h +++ b/src/lib/eina/eina_unicode.h @@ -128,7 +128,7 @@ EAPI Eina_Unicode *eina_unicode_escape(const Eina_Unicode *str) EINA_ARG_NONNULL * * @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_next(const char *buf, int *iindex) EINA_ARG_NONNULL(1, 2);