mirror of
https://git.zap.org.au/git/trader.git
synced 2024-09-01 17:14:15 -04:00
Replace "tv.tv_sec * tv.tv_usec" with "tv.tv_sec + tv.tv_usec"
This allows the lower bits of seed to hopefully contain something useful instead of just zeros!
This commit is contained in:
parent
a9f52e89be
commit
1a44ff6513
@ -270,7 +270,7 @@ void init_rand (void)
|
|||||||
unsigned long int seed;
|
unsigned long int seed;
|
||||||
|
|
||||||
gettimeofday(&tv, NULL); // If this fails, tv is random enough!
|
gettimeofday(&tv, NULL); // If this fails, tv is random enough!
|
||||||
seed = tv.tv_sec * tv.tv_usec;
|
seed = tv.tv_sec + tv.tv_usec;
|
||||||
|
|
||||||
srand48(seed);
|
srand48(seed);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user