aboutsummaryrefslogtreecommitdiff
path: root/lmathlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lmathlib.c')
-rw-r--r--lmathlib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lmathlib.c b/lmathlib.c
index 711f1d3a..1e5c3ede 100644
--- a/lmathlib.c
+++ b/lmathlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lmathlib.c,v 1.102 2014/06/02 23:09:28 roberto Exp roberto $ 2** $Id: lmathlib.c,v 1.103 2014/06/18 12:35:53 roberto Exp roberto $
3** Standard mathematical library 3** Standard mathematical library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -257,7 +257,7 @@ static int math_random (lua_State *L) {
257 257
258 258
259static int math_randomseed (lua_State *L) { 259static int math_randomseed (lua_State *L) {
260 l_srand((unsigned int)luaL_checkunsigned(L, 1)); 260 l_srand((unsigned int)(lua_Integer)luaL_checknumber(L, 1));
261 (void)rand(); /* discard first value to avoid undesirable correlations */ 261 (void)rand(); /* discard first value to avoid undesirable correlations */
262 return 0; 262 return 0;
263} 263}