aboutsummaryrefslogtreecommitdiff
path: root/src/math.c
diff options
context:
space:
mode:
authorame <[email protected]>2026-06-30 04:30:10 -0500
committerame <[email protected]>2026-06-30 04:30:10 -0500
commit7f96376ffdd63397a4265975ec4018c4465094f9 (patch)
tree28c1c9fc949f08d6828dc5d86604931bb741a4dc /src/math.c
parentfb6a20845fed68f1fc3bb5722bb1f5f7f9469d95 (diff)
table.contains and some check safteystate-copy-changes
Diffstat (limited to 'src/math.c')
-rw-r--r--src/math.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/math.c b/src/math.c
index e7cd1bb..47e8391 100644
--- a/src/math.c
+++ b/src/math.c
@@ -65,10 +65,10 @@ int l_random(lua_State* L){
size_t min = 1;
switch(lua_gettop(L)){
case 2:
- min = lua_tointeger(L, 1);
+ min = luaL_checkinteger(L, 1);
lua_remove(L, 1);
case 1:
- lua_pushinteger(L, (erand48(seedv) * (lua_tointeger(L, 1) - min + 1)) + min);
+ lua_pushinteger(L, (erand48(seedv) * (luaL_checkinteger(L, 1) - min + 1)) + min);
break;
case 0:
default: