Use luaL_check/optinteger instead of luaL_check/optnumber when getting integer arguments to functions. Resolves issue #1251.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-07-16 12:17:50 -03:00
parent abcade9421
commit 34ebe18f14
30 changed files with 127 additions and 127 deletions
+2 -2
View File
@@ -39,8 +39,8 @@ int w_newImageData(lua_State *L)
// Case 1: width & height.
if (lua_isnumber(L, 1))
{
int w = (int) luaL_checknumber(L, 1);
int h = (int) luaL_checknumber(L, 2);
int w = (int) luaL_checkinteger(L, 1);
int h = (int) luaL_checkinteger(L, 2);
if (w <= 0 || h <= 0)
return luaL_error(L, "Invalid image size.");