aboutsummaryrefslogtreecommitdiff
path: root/ldblib.c
diff options
context:
space:
mode:
authorRoberto I <roberto@inf.puc-rio.br>2026-04-07 13:42:34 -0300
committerRoberto I <roberto@inf.puc-rio.br>2026-04-07 13:42:34 -0300
commit29cf284089d543408d726440a3f1acaecdf73636 (patch)
treee18363e7d53bb64d6f82943556ff0c3110778837 /ldblib.c
parentc037162a1a657088d722f550e287015525bb2259 (diff)
downloadlua-29cf284089d543408d726440a3f1acaecdf73636.tar.gz
lua-29cf284089d543408d726440a3f1acaecdf73636.tar.bz2
lua-29cf284089d543408d726440a3f1acaecdf73636.zip
Avoid macros luaL_loadbuffer and luaL_loadfile
Use luaL_loadbufferx and luaL_loadfilex instead, being explicit about whether to accept binary chunks.
Diffstat (limited to 'ldblib.c')
-rw-r--r--ldblib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ldblib.c b/ldblib.c
index c7b74812..051327cc 100644
--- a/ldblib.c
+++ b/ldblib.c
@@ -427,7 +427,7 @@ static int db_debug (lua_State *L) {
427 if (fgets(buffer, sizeof(buffer), stdin) == NULL || 427 if (fgets(buffer, sizeof(buffer), stdin) == NULL ||
428 strcmp(buffer, "cont\n") == 0) 428 strcmp(buffer, "cont\n") == 0)
429 return 0; 429 return 0;
430 if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") || 430 if (luaL_loadbufferx(L, buffer, strlen(buffer), "=(debug command)", "t") ||
431 lua_pcall(L, 0, 0, 0)) 431 lua_pcall(L, 0, 0, 0))
432 lua_writestringerror("%s\n", luaL_tolstring(L, -1, NULL)); 432 lua_writestringerror("%s\n", luaL_tolstring(L, -1, NULL));
433 lua_settop(L, 0); /* remove eventual returns */ 433 lua_settop(L, 0); /* remove eventual returns */