summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Bindings/ManualBindings.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index 451161d87..7255f73a4 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -115,10 +115,10 @@ static int tolua_CompressStringZLIB(lua_State * tolua_S)
{
cLuaState S(tolua_S);
if (
- !lua_isstring(tolua_S, 1) ||
+ !S.CheckParamString(1) &&
(
- !lua_isnumber(tolua_S, 2) &&
- !lua_isnil(tolua_S, 2)
+ !S.CheckParamNumber(2) ||
+ !S.CheckParamEnd(2)
)
)
{
@@ -146,8 +146,8 @@ static int tolua_UncompressStringZLIB(lua_State * tolua_S)
{
cLuaState S(tolua_S);
if (
- !lua_isstring(tolua_S, 1) ||
- !lua_isnumber(tolua_S, 2)
+ !S.CheckParamString(1) &&
+ !S.CheckParamNumber(2)
)
{
cLuaState::LogStackTrace(tolua_S);
@@ -173,7 +173,10 @@ static int tolua_UncompressStringZLIB(lua_State * tolua_S)
static int tolua_CompressStringGZIP(lua_State * tolua_S)
{
cLuaState S(tolua_S);
- if (!lua_isstring(tolua_S, 1))
+ if (
+ !S.CheckParamString(1) &&
+ !S.CheckParamEnd(2)
+ )
{
cLuaState::LogStackTrace(tolua_S);
return 0;
@@ -198,15 +201,14 @@ static int tolua_UncompressStringGZIP(lua_State * tolua_S)
{
cLuaState S(tolua_S);
if (
- !lua_isstring(tolua_S, 1)
+ !S.CheckParamString(1) &&
+ !S.CheckParamEnd(2)
)
{
cLuaState::LogStackTrace(tolua_S);
return 0;
}
-
-
// Get the params:
AString ToUncompress;
S.GetStackValues(1, ToUncompress);
@@ -226,15 +228,14 @@ static int tolua_InflateString(lua_State * tolua_S)
{
cLuaState S(tolua_S);
if (
- !lua_isstring(tolua_S, 1)
+ !S.CheckParamString(1) &&
+ !S.CheckParamEnd(2)
)
{
cLuaState::LogStackTrace(tolua_S);
return 0;
}
-
-
// Get the params:
AString ToUncompress;
S.GetStackValues(1, ToUncompress);