X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fluci-lib-jsonc%2Fsrc%2Fjsonc.c;h=971fb122f7655b379e717ef78a5417032ead9a57;hp=827fde8843082e956b0c89b5855feeabd790e880;hb=a36a73cbdcfb54e1c23453b2541ca74bf36ee79a;hpb=e32a877aa48d0e9d87d999026a6c49707b42a7bf diff --git a/libs/luci-lib-jsonc/src/jsonc.c b/libs/luci-lib-jsonc/src/jsonc.c index 827fde884..971fb122f 100644 --- a/libs/luci-lib-jsonc/src/jsonc.c +++ b/libs/luci-lib-jsonc/src/jsonc.c @@ -222,7 +222,7 @@ static int _lua_test_array(lua_State *L, int index) out: lua_pop(L, 2); - return 0; + return -1; } /* check for holes */ @@ -254,7 +254,7 @@ static struct json_object * _lua_to_json(lua_State *L, int index) case LUA_TTABLE: max = _lua_test_array(L, index); - if (max > 0) + if (max >= 0) { obj = json_object_new_array();