From: Ismo Puustinen Date: Mon, 22 Sep 2014 09:58:41 +0000 (+0300) Subject: lua-object: always init variable length when iterating object fields. X-Git-Tag: v0.0.60~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5fa4a9b630a0164a3b650c4057150fee3e7550d3;p=profile%2Fivi%2Fmurphy.git lua-object: always init variable length when iterating object fields. --- diff --git a/src/core/lua-utils/object.h b/src/core/lua-utils/object.h index f4a8e50..5638b3a 100644 --- a/src/core/lua-utils/object.h +++ b/src/core/lua-utils/object.h @@ -130,13 +130,13 @@ + #define MRP_LUA_FOREACH_FIELD(_L, _i, _n, _l) \ for (lua_pushnil(_L); \ \ - lua_next(_L, _i) && \ + !(_l = 0) && lua_next(_L, _i) && \ (_n = (lua_type(_L, -2) == LUA_TSTRING) ? \ - lua_tolstring(_L, -2, &_l) : "" ) && \ - ((lua_type(_L, -2) == LUA_TSTRING) || !( _l = 0)); \ + lua_tolstring(_L, -2, &_l) : "" ); \ \ lua_pop(_L, 1))