diff --git a/src/torrent.cpp b/src/torrent.cpp index cc5b5fa4e..c85919b77 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -1375,7 +1375,7 @@ namespace libtorrent const std::vector& dl_queue = m_picker->get_download_queue(); - const int blocks_per_piece = piece_size / m_block_size; + const int blocks_per_piece = (piece_size + m_block_size - 1) / m_block_size; for (std::vector::const_iterator i = dl_queue.begin(); i != dl_queue.end(); ++i)