mirror of
https://git.freebsd.org/ports.git
synced 2025-06-07 13:50:38 -04:00
20 lines
748 B
Text
20 lines
748 B
Text
--- src/lib/lmathlib.c.orig Mon Apr 30 00:05:45 2001
|
|
+++ src/lib/lmathlib.c Mon Apr 30 00:06:05 2001
|
|
@@ -168,7 +168,7 @@
|
|
static int math_random (lua_State *L) {
|
|
/* the '%' avoids the (rare) case of r==1, and is needed also because on
|
|
some systems (SunOS!) "rand()" may return a value larger than RAND_MAX */
|
|
- double r = (double)(rand()%RAND_MAX) / (double)RAND_MAX;
|
|
+ double r = (double)(random()%RAND_MAX) / (double)RAND_MAX;
|
|
switch (lua_gettop(L)) { /* check number of arguments */
|
|
case 0: { /* no arguments */
|
|
lua_pushnumber(L, r); /* Number between 0 and 1 */
|
|
@@ -194,7 +194,7 @@
|
|
|
|
|
|
static int math_randomseed (lua_State *L) {
|
|
- srand(luaL_check_int(L, 1));
|
|
+ srandom(luaL_check_int(L, 1));
|
|
return 0;
|
|
}
|
|
|