srandom(time()) is too weak even for joke, use srandom(time() ^ getpid())
at least. Note that srandomdev can't be used here since gawk preserve old seed value.
This commit is contained in:
parent
d021ae3db5
commit
fca096e2e1
@ -1263,7 +1263,11 @@ NODE *tree;
|
||||
(void) setstate(state);
|
||||
|
||||
if (tree == NULL)
|
||||
#ifdef __FreeBSD__
|
||||
srandom((unsigned int) (save_seed = (long) time((time_t *) 0) ^ getpid()));
|
||||
#else
|
||||
srandom((unsigned int) (save_seed = (long) time((time_t *) 0)));
|
||||
#endif
|
||||
else {
|
||||
tmp = tree_eval(tree->lnode);
|
||||
srandom((unsigned int) (save_seed = (long) force_number(tmp)));
|
||||
|
Loading…
Reference in New Issue
Block a user