mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
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:
@@ -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.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user