summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorHugh Graham <hugh@cvs.openbsd.org>2000-04-18 15:11:29 +0000
committerHugh Graham <hugh@cvs.openbsd.org>2000-04-18 15:11:29 +0000
commit78819b347264b560475e1ebb71c5f03c5bab9b74 (patch)
tree8e71f18867c64dd0058b6bc278fbbd21072876c2 /sys/dev
parent9dfc0734524ed33ae99f257789e994b93bb775cf (diff)
Double usage of random() in the pseudo device to avoid setting
every 32nd bit to zero in the output. Checked by mickey.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/rnd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c
index 5128e67c0f2..dede449fae9 100644
--- a/sys/dev/rnd.c
+++ b/sys/dev/rnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rnd.c,v 1.37 2000/04/14 14:40:50 mickey Exp $ */
+/* $OpenBSD: rnd.c,v 1.38 2000/04/18 15:11:28 hugh Exp $ */
/*
* random.c -- A strong random number generator
@@ -967,7 +967,7 @@ randomread(dev, uio, ioflag)
case RND_PRND:
i = (n + 3) / 4;
while (i--)
- buf[i] = random();
+ buf[i] = random() << 16 | (random() & 0xFFFF);
break;
case RND_ARND:
{