aboutsummaryrefslogtreecommitdiff
path: root/src/lib_aux.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib_aux.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib_aux.c b/src/lib_aux.c
index 104888bd..f25ab65a 100644
--- a/src/lib_aux.c
+++ b/src/lib_aux.c
@@ -314,8 +314,11 @@ LUALIB_API int luaL_loadstring(lua_State *L, const char *s)
314 314
315static int panic(lua_State *L) 315static int panic(lua_State *L)
316{ 316{
317 fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n", 317 const char *s = lua_tostring(L, -1);
318 lua_tostring(L, -1)); 318 fputs("PANIC: unprotected error in call to Lua API (", stderr);
319 fputs(s ? s : "?", stderr);
320 fputc(')', stderr); fputc('\n', stderr);
321 fflush(stderr);
319 return 0; 322 return 0;
320} 323}
321 324
@@ -366,7 +369,7 @@ LUALIB_API lua_State *luaL_newstate(void)
366LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud) 369LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud)
367{ 370{
368 UNUSED(f); UNUSED(ud); 371 UNUSED(f); UNUSED(ud);
369 fprintf(stderr, "Must use luaL_newstate() for 64 bit target\n"); 372 fputs("Must use luaL_newstate() for 64 bit target\n", stderr);
370 return NULL; 373 return NULL;
371} 374}
372#endif 375#endif