diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-09-08 15:47:14 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-09-08 15:47:14 +0000 |
commit | 6cfd5ea7086c16bedf34dfa0b3283bb8e558c285 (patch) | |
tree | bac1d2c2fd13229ad608fc4eb751c8c7ea9b77e1 /util.c | |
parent | cb08c2557abf1c4c87bdbc194618d6c10a9350cc (diff) | |
download | perl-6cfd5ea7086c16bedf34dfa0b3283bb8e558c285.tar.gz |
Slightly more intelligent paranoia.
p4raw-id: //depot/perl@21093
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; |