From ffc3badc50f6dd5b2a143b545693b3f21150c831 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Fri, 14 Feb 2025 21:52:06 +0300 Subject: [PATCH] /apps/twnlua: output lua_loadbuffer errors --- apps/twnlua/game.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/twnlua/game.c b/apps/twnlua/game.c index 0fd7330..f578a39 100644 --- a/apps/twnlua/game.c +++ b/apps/twnlua/game.c @@ -47,10 +47,13 @@ static int physfs_loader(lua_State *L) { free(final_path); /* TODO: use reader interface for streaming instead */ - int const result = luaL_loadbuffer(L, (char *)buf, buf_size, name) == LUA_OK; + int const result = luaL_loadbuffer(L, (char *)buf, buf_size, name); free(buf); - return result; + if (result != LUA_OK) + log_critical("%s", lua_tostring(L, -1)); + + return result == LUA_OK; }