fix to file_progress improvement

This commit is contained in:
Arvid Norberg 2008-07-09 15:23:42 +00:00
parent 066fb98864
commit 06f3ad65e8
2 changed files with 2 additions and 2 deletions

View File

@ -70,7 +70,7 @@ namespace libtorrent
std::vector<file_entry>::const_iterator i;
for (i = begin(); i != end(); ++i)
{
if (i->offset < offset && i->offset + i->size > offset)
if (i->offset <= offset && i->offset + i->size > offset)
return i;
}
return i;

View File

@ -4035,7 +4035,7 @@ namespace libtorrent
size_type block_size = m_block_size;
while (offset + block_size > file->offset + file->size)
{
TORRENT_ASSERT(offset < file->offset + file->size);
TORRENT_ASSERT(offset <= file->offset + file->size);
size_type slice = file->offset + file->size - offset;
fp[file_index] += float(slice) / file->size;
offset += slice;