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
9bb743990a
commit
ad58c6f873
@ -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