mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-21 06:03:12 +00:00
Don't use an uninitialised variable.
A compiler is well within its rights to throw this value away completely (and clang does so). See http://kqueue.org/blog/2012/06/25/more-randomness-or-less/
This commit is contained in:
parent
e7201963d0
commit
9546903ce7
@ -77,8 +77,7 @@ srandomdev(void)
|
||||
{
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
/* NOTE: intentional use of uninitialized variable */
|
||||
seed ^= (getpid() << 16) ^ tv.tv_sec ^ tv.tv_usec;
|
||||
seed = (getpid() << 16) ^ tv.tv_sec ^ tv.tv_usec;
|
||||
}
|
||||
srandom(seed);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user