summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--player/lua.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/player/lua.c b/player/lua.c
index 8bf8f2b590..1ad6bff682 100644
--- a/player/lua.c
+++ b/player/lua.c
@@ -709,7 +709,7 @@ static void makenode(void *tmp, mpv_node *dst, lua_State *L, int t)
bool empty = lua_isnil(L, -1); // t[n]
lua_pop(L, 1); // -
if (empty) {
- count = n;
+ count = n - 1;
break;
}
}
@@ -751,7 +751,7 @@ static void makenode(void *tmp, mpv_node *dst, lua_State *L, int t)
makenode(tmp, &list->values[list->num], L, -1);
if (lua_type(L, -2) != LUA_TSTRING) {
luaL_error(L, "key must be a string, but got %s",
- lua_typename(L, -2));
+ lua_typename(L, lua_type(L, -2)));
}
list->keys[list->num] = talloc_strdup(tmp, lua_tostring(L, -2));
list->num++;