fixed division by zero

This commit is contained in:
Arvid Norberg 2011-03-21 08:19:00 +00:00
parent 21e87527fd
commit d3f0875ed5
1 changed files with 2 additions and 0 deletions

View File

@ -2461,6 +2461,8 @@ namespace aux {
conns.push_back(p);
}
if (conns.empty()) return;
// pick a random peer to start with, to evenly distribute
// the disk bandwidth
std::vector<peer_connection*>::iterator peer = conns.begin() + (rand() % conns.size());