summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-12-14 21:35:23 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2013-12-14 21:35:23 +0100
commit5de0329f2184bdf89e087f414b651448df096c1f (patch)
tree69d087fd776e69b53ee908f1eaf18113b0a20015 /src
parent72d30efe23793925d20c5d493cda45248b99f971 (diff)
QPhotoRec: fix "Reading sector" display
Diffstat (limited to 'src')
-rw-r--r--src/qphotorec.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qphotorec.cpp b/src/qphotorec.cpp
index c38599f..75c4bf0 100644
--- a/src/qphotorec.cpp
+++ b/src/qphotorec.cpp
@@ -618,7 +618,9 @@ void QPhotorec::qphotorec_search_updateUI()
{
tmp.sprintf("Pass %u - Reading sector %10llu/%llu",
params->pass,
- (unsigned long long)((params->offset-partition->part_offset)/sector_size),
+ (unsigned long long)(params->offset>partition->part_offset && params->offset < partition->part_size ?
+ ((params->offset-partition->part_offset)/sector_size):
+ 0),
(unsigned long long)(partition->part_size/sector_size));
}
progress_info->setText(tmp);