From 7867cf68f97d65fff14886980f2fecf807c6c1a7 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Mon, 11 Oct 2010 19:50:32 +0000 Subject: [PATCH] Fix possible variable overflow --- src/downloadedpiecesbar.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/downloadedpiecesbar.h b/src/downloadedpiecesbar.h index 974eed68d..5f9c5c96a 100644 --- a/src/downloadedpiecesbar.h +++ b/src/downloadedpiecesbar.h @@ -60,16 +60,16 @@ public: pix.fill(); pixmap = pix; } else { - const int nb_pieces = pieces.size(); + const qulonglong nb_pieces = pieces.size(); // Reduce the number of pieces before creating the pixmap // otherwise it can crash when there are too many pieces - if(nb_pieces > width()) { + if(nb_pieces > (uint)width()) { const int ratio = floor(nb_pieces/(double)width()); std::vector scaled_pieces; std::vector scaled_downloading; - for(int i=0; i