diff options
| author | ame <[email protected]> | 2026-06-30 04:30:10 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2026-06-30 04:30:10 -0500 |
| commit | 7f96376ffdd63397a4265975ec4018c4465094f9 (patch) | |
| tree | 28c1c9fc949f08d6828dc5d86604931bb741a4dc /src/math.c | |
| parent | fb6a20845fed68f1fc3bb5722bb1f5f7f9469d95 (diff) | |
table.contains and some check safteystate-copy-changes
Diffstat (limited to 'src/math.c')
| -rw-r--r-- | src/math.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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: |
