diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2002-06-11 07:54:23 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2002-06-11 07:54:23 +0000 |
commit | 7bd47529529473d6cd91d7fba0f59c5921d63df5 (patch) | |
tree | bf6a22f8f9d7841b064e398f7c06e54584afd6c8 /sys/ddb/db_hangman.c | |
parent | 861e736e9f1e944cf63126116ce317462d237fff (diff) |
can't call arc4random() before timeouts are enabled, use random() if cold.
Diffstat (limited to 'sys/ddb/db_hangman.c')
-rw-r--r-- | sys/ddb/db_hangman.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/ddb/db_hangman.c b/sys/ddb/db_hangman.c index 2e94aeddfe1..83a51b3fff5 100644 --- a/sys/ddb/db_hangman.c +++ b/sys/ddb/db_hangman.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_hangman.c,v 1.20 2002/03/14 01:26:51 millert Exp $ */ +/* $OpenBSD: db_hangman.c,v 1.21 2002/06/11 07:54:22 jason Exp $ */ /* * Copyright (c) 1996 Theo de Raadt, Michael Shalayeff @@ -55,7 +55,9 @@ u_long db_plays, db_guesses; static __inline size_t db_random(size_t mod) { - return arc4random() % mod; + if (cold) + return (random() % mod); + return (arc4random() % mod); } struct db_hang_forall_arg { |