From 203079bcfac29638efd3166b651027b12b1c97fe Mon Sep 17 00:00:00 2001 From: Allanis Date: Sun, 30 Jun 2013 17:19:40 +0100 Subject: [PATCH] [Add] Check for errors when using "include". --- src/llua.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/llua.c b/src/llua.c index b44e309..b39775b 100644 --- a/src/llua.c +++ b/src/llua.c @@ -83,7 +83,8 @@ lua_State* llua_newState(void) { /* Open a lua library. */ int llua_load(lua_State* L, lua_CFunction f) { lua_pushcfunction(L, f); - lua_pcall(L, 0, 0, 0); + if(lua_pcall(L, 0, 0, 0)) + WARN("llua include error: %s", lua_tostring(L, -1)); return 0; }