summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-09-08 15:47:14 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-09-08 15:47:14 +0000
commit6cfd5ea7086c16bedf34dfa0b3283bb8e558c285 (patch)
treebac1d2c2fd13229ad608fc4eb751c8c7ea9b77e1 /util.c
parentcb08c2557abf1c4c87bdbc194618d6c10a9350cc (diff)
downloadperl-6cfd5ea7086c16bedf34dfa0b3283bb8e558c285.tar.gz
Slightly more intelligent paranoia.
p4raw-id: //depot/perl@21093
Diffstat (limited to 'util.c')
-rw-r--r--util.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/util.c b/util.c
index 39122be6c4..c750a2e68d 100644
--- a/util.c
+++ b/util.c
@@ -4422,8 +4422,11 @@ Perl_get_hash_seed(pTHX)
myseed +=
(UV)(Drand01() * (NV)((1 << ((UVSIZE * 8 - RANDBITS))) - 1));
#endif /* RANDBITS < (UVSIZE * 8) */
- while (myseed == 0) /* Superparanoia. */
- myseed += (UV)(Drand01() * (NV)UV_MAX);
+ if (myseed == 0) { /* Superparanoia. */
+ myseed = (UV)(Drand01() * (NV)UV_MAX); /* One more chance. */
+ if (myseed == 0)
+ Perl_croak(aTHX_ "Your random numbers are not that random");
+ }
}
PL_hash_seed_set = TRUE;