aboutsummaryrefslogtreecommitdiffstats
path: root/lang/nawk/files
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2001-05-01 01:44:40 +0800
committerobrien <obrien@FreeBSD.org>2001-05-01 01:44:40 +0800
commitcd36117808f04cf7c774df25b14e09afb2b8ff2e (patch)
tree26817072cd3a7b0a04d9c3668384c3410d18b4b6 /lang/nawk/files
parent46c2ce687a67e6a8a9dbdca5c6a8591743bea260 (diff)
downloadfreebsd-ports-gnome-cd36117808f04cf7c774df25b14e09afb2b8ff2e.tar.gz
freebsd-ports-gnome-cd36117808f04cf7c774df25b14e09afb2b8ff2e.tar.zst
freebsd-ports-gnome-cd36117808f04cf7c774df25b14e09afb2b8ff2e.zip
Use [s]random() rather than [s]rand().
Submitted by: kris
Diffstat (limited to 'lang/nawk/files')
-rw-r--r--lang/nawk/files/patch-run.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/lang/nawk/files/patch-run.c b/lang/nawk/files/patch-run.c
new file mode 100644
index 000000000000..430c350e847d
--- /dev/null
+++ b/lang/nawk/files/patch-run.c
@@ -0,0 +1,21 @@
+--- run.c.orig Mon Oct 30 13:26:57 2000
++++ run.c Mon Apr 30 00:00:26 2001
+@@ -1483,15 +1483,15 @@
+ u = (Awkfloat) system(getsval(x)) / 256; /* 256 is unix-dep */
+ break;
+ case FRAND:
+- /* in principle, rand() returns something in 0..RAND_MAX */
+- u = (Awkfloat) (rand() % RAND_MAX) / RAND_MAX;
++ /* in principle, random() returns something in 0..RAND_MAX */
++ u = (Awkfloat) (random() % RAND_MAX) / RAND_MAX;
+ break;
+ case FSRAND:
+ if (isrec(x)) /* no argument provided */
+ u = time((time_t *)0);
+ else
+ u = getfval(x);
+- srand((unsigned int) u);
++ srandom((unsigned int) u);
+ break;
+ case FTOUPPER:
+ case FTOLOWER: