From: bert hubert Date: Sun, 18 Oct 2015 10:58:50 +0000 (+0200) Subject: make sure luaStackDump() actually works (we trip over L..) X-Git-Tag: dnsdist-1.0.0-alpha1~262^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e16a1bf06cc246e7c1a37c261433ffecc5c80884;p=thirdparty%2Fpdns.git make sure luaStackDump() actually works (we trip over L..) --- diff --git a/pdns/lua-pdns.cc b/pdns/lua-pdns.cc index e7c07dccda..87063360be 100644 --- a/pdns/lua-pdns.cc +++ b/pdns/lua-pdns.cc @@ -372,27 +372,27 @@ PowerDNSLua::~PowerDNSLua() } #if 0 -void luaStackDump (lua_State *L) { +void luaStackDump (lua_State *Lua) { int i; - int top = lua_gettop(L); + int top = lua_gettop(Lua); for (i = 1; i <= top; i++) { /* repeat for each level */ - int t = lua_type(L, i); + int t = lua_type(Lua, i); switch (t) { case LUA_TSTRING: /* strings */ - printf("`%s'", lua_tostring(L, i)); + printf("`%s'", lua_tostring(Lua, i)); break; case LUA_TBOOLEAN: /* booleans */ - printf(lua_toboolean(L, i) ? "true" : "false"); + printf(lua_toboolean(Lua, i) ? "true" : "false"); break; case LUA_TNUMBER: /* numbers */ - printf("%g", lua_tonumber(L, i)); + printf("%g", lua_tonumber(Lua, i)); break; default: /* other values */ - printf("%s", lua_typename(L, t)); + printf("%s", lua_typename(Lua, t)); break; } diff --git a/pdns/lua-pdns.hh b/pdns/lua-pdns.hh index f5a6ba5c7f..07e394bc2f 100644 --- a/pdns/lua-pdns.hh +++ b/pdns/lua-pdns.hh @@ -37,6 +37,6 @@ void pushResourceRecordsTable(lua_State* lua, const vector& records); void popResourceRecordsTable(lua_State *lua, const DNSName &query, vector& ret); void pushSyslogSecurityLevelTable(lua_State *lua); int getLuaTableLength(lua_State* lua, int depth); -void luaStackDump (lua_State *L); +void luaStackDump (lua_State *lua); extern "C" int luaopen_iputils(lua_State*); #endif