mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 22:03:27 -07:00
Merge pull request #2958 from Chocobo1/neg_loop
Fix potential negative loop bound
This commit is contained in:
commit
174861274b
2 changed files with 4 additions and 4 deletions
|
@ -732,8 +732,8 @@ void QTorrentHandle::prioritize_first_last_piece(bool b) const
|
|||
{
|
||||
if (!has_metadata()) return;
|
||||
// Download first and last pieces first for all media files in the torrent
|
||||
const uint nbfiles = num_files();
|
||||
for (uint index = 0; index < nbfiles; ++index) {
|
||||
const int nbfiles = num_files();
|
||||
for (int index = 0; index < nbfiles; ++index) {
|
||||
const QString path = filepath_at(index);
|
||||
const QString ext = fsutils::fileExtension(path);
|
||||
if (misc::isPreviewable(ext) && torrent_handle::file_priority(index) > 0) {
|
||||
|
|
|
@ -60,8 +60,8 @@ PreviewSelect::PreviewSelect(QWidget* parent, QTorrentHandle h): QDialog(parent)
|
|||
// Fill list in
|
||||
std::vector<libtorrent::size_type> fp;
|
||||
h.file_progress(fp);
|
||||
unsigned int nbFiles = h.num_files();
|
||||
for (unsigned int i=0; i<nbFiles; ++i) {
|
||||
int nbFiles = h.num_files();
|
||||
for (int i=0; i<nbFiles; ++i) {
|
||||
QString fileName = h.filename_at(i);
|
||||
if (fileName.endsWith(".!qB"))
|
||||
fileName.chop(4);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue