summaryrefslogtreecommitdiffstats
path: root/src/Bindings
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-09-28 15:15:06 +0200
committerworktycho <work.tycho@gmail.com>2015-09-28 15:15:06 +0200
commita59800ca0cf17031523b05d7dae7955c4dd777a3 (patch)
tree48606b0db6225a4b6974d591d8490f27c3166542 /src/Bindings
parentMerge pull request #2498 from cuberite/UnicodeOnWindows (diff)
parentMade Lua API check strings strictly. (diff)
downloadcuberite-a59800ca0cf17031523b05d7dae7955c4dd777a3.tar
cuberite-a59800ca0cf17031523b05d7dae7955c4dd777a3.tar.gz
cuberite-a59800ca0cf17031523b05d7dae7955c4dd777a3.tar.bz2
cuberite-a59800ca0cf17031523b05d7dae7955c4dd777a3.tar.lz
cuberite-a59800ca0cf17031523b05d7dae7955c4dd777a3.tar.xz
cuberite-a59800ca0cf17031523b05d7dae7955c4dd777a3.tar.zst
cuberite-a59800ca0cf17031523b05d7dae7955c4dd777a3.zip
Diffstat (limited to 'src/Bindings')
-rw-r--r--src/Bindings/LuaState.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp
index c9e7815ca..1509bd19f 100644
--- a/src/Bindings/LuaState.cpp
+++ b/src/Bindings/LuaState.cpp
@@ -1065,7 +1065,7 @@ bool cLuaState::CheckParamString(int a_StartParam, int a_EndParam)
tolua_Error tolua_err;
for (int i = a_StartParam; i <= a_EndParam; i++)
{
- if (tolua_isstring(m_LuaState, i, 0, &tolua_err))
+ if (lua_isstring(m_LuaState, i))
{
continue;
}
@@ -1073,6 +1073,9 @@ bool cLuaState::CheckParamString(int a_StartParam, int a_EndParam)
lua_Debug entry;
VERIFY(lua_getstack(m_LuaState, 0, &entry));
VERIFY(lua_getinfo (m_LuaState, "n", &entry));
+ tolua_err.array = 0;
+ tolua_err.type = "string";
+ tolua_err.index = i;
AString ErrMsg = Printf("#ferror in function '%s'.", (entry.name != nullptr) ? entry.name : "?");
tolua_error(m_LuaState, ErrMsg.c_str(), &tolua_err);
return false;