fix: off-by-one when marking a range of pieces as untested
This commit is contained in:
parent
1c800511d7
commit
7b772e73e6
|
@ -237,7 +237,9 @@ struct tr_torrent
|
|||
// if a file has changed, mark its pieces as unchecked
|
||||
if (mtime == 0 || mtime != mtimes[i])
|
||||
{
|
||||
checked_pieces_.unsetRange(info.files[i].firstPiece, info.files[i].lastPiece);
|
||||
auto const begin = info.files[i].firstPiece;
|
||||
auto const end = info.files[i].lastPiece + 1;
|
||||
checked_pieces_.unsetRange(begin, end);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue