fix piece_picker piece-shuffle bug

This commit is contained in:
Arvid Norberg 2008-07-31 09:19:52 +00:00
parent b5467845d7
commit 6b2338c5dd
1 changed files with 1 additions and 1 deletions

View File

@ -513,7 +513,7 @@ namespace libtorrent
priority_range(priority, &range_start, &range_end);
int new_index;
if (range_end == range_start) new_index = range_start;
else new_index = rand() % (range_end - range_start) + range_start;
else new_index = rand() % (range_end - range_start + 1) + range_start;
#ifdef TORRENT_PICKER_LOG
std::cerr << "add " << index << " (" << priority << ")" << std::endl;