mirror of
https://github.com/sheumann/telnetd.git
synced 2024-11-26 12:49:21 +00:00
srandomdev() affords us the opportunity to radically improve, and at the
same time simplify, the random number selection code. git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@76691 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
This commit is contained in:
parent
0a0c02d634
commit
e7c0163dfe
@ -117,6 +117,7 @@ void getseed(seed, seedsize)
|
|||||||
char *seed;
|
char *seed;
|
||||||
int seedsize;
|
int seedsize;
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
int i,f;
|
int i,f;
|
||||||
int rseed;
|
int rseed;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
@ -140,6 +141,12 @@ void getseed(seed, seedsize)
|
|||||||
for (i = 0; i < seedsize; i++) {
|
for (i = 0; i < seedsize; i++) {
|
||||||
seed[i] = (lrand48() & 0xff);
|
seed[i] = (lrand48() & 0xff);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
srandomdev();
|
||||||
|
for (i = 0; i < seedsize; i++) {
|
||||||
|
seed[i] = random() & 0xff;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user