mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 12:53:42 +02:00
Removed all srand calls and added a single srand invokation in at startup
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4264 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
47704b800d
commit
4de9baf8f1
6 changed files with 4 additions and 5 deletions
|
|
@ -440,7 +440,6 @@ int net_gethostbyname(const char *addr, IPADDR *ip4, IPADDR *ip6)
|
|||
return HOST_NOT_FOUND; /* shouldn't happen? */
|
||||
|
||||
/* if there are multiple addresses, return random one */
|
||||
srand(time(NULL));
|
||||
use_v4 = count_v4 <= 1 ? 0 : rand() % count_v4;
|
||||
use_v6 = count_v6 <= 1 ? 0 : rand() % count_v6;
|
||||
|
||||
|
|
@ -475,7 +474,6 @@ int net_gethostbyname(const char *addr, IPADDR *ip4, IPADDR *ip6)
|
|||
|
||||
/* if there are multiple addresses, return random one */
|
||||
ip4->family = AF_INET;
|
||||
srand(time(NULL));
|
||||
memcpy(&ip4->ip, hp->h_addr_list[rand() % count], 4);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue