From 5934913790078037b677982c4cd138876e3ee4ee Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Thu, 26 Jan 2017 19:42:52 +0100 Subject: Lua: fix setting chunk.position Double decrement. --- hex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hex.c b/hex.c index ffbf5b1..532b539 100644 --- a/hex.c +++ b/hex.c @@ -975,9 +975,9 @@ app_lua_chunk_newindex (lua_State *L) } else if (!strcmp (key, "position")) { - lua_Integer position = luaL_checkinteger (L, 3) - 1; + lua_Integer position = luaL_checkinteger (L, 3); if (position < 1 || position > self->len + 1) - return luaL_error (L, "position out of range: %" PRId64, position); + return luaL_error (L, "position out of range: %I", position); self->position = position - 1; } else -- cgit v1.2.3-70-g09d2