From 06f3ad65e81156bd708c137dee85522659b37f68 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 9 Jul 2008 15:23:42 +0000 Subject: [PATCH] fix to file_progress improvement --- src/file_storage.cpp | 2 +- src/torrent.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/file_storage.cpp b/src/file_storage.cpp index e5b544dc3..a0c4145f3 100644 --- a/src/file_storage.cpp +++ b/src/file_storage.cpp @@ -70,7 +70,7 @@ namespace libtorrent std::vector::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; diff --git a/src/torrent.cpp b/src/torrent.cpp index 38d7113cb..afd792984 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -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;