summaryrefslogtreecommitdiffstats
path: root/src/phnc.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-05-15 10:00:25 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2013-05-15 10:00:25 +0200
commit9e18c597cb24f7d68fb6d8b49bf0f9c13c918749 (patch)
tree1598ba06f878df8ef335031a8df00a557188c641 /src/phnc.c
parent7afe29c487f68e7fe3978e3ffd10a6860953c357 (diff)
Harmonize photorec_progressbar() and fat_unformat_aux() code
Diffstat (limited to 'src/phnc.c')
-rw-r--r--src/phnc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/phnc.c b/src/phnc.c
index 8ac4e9c..2f6334c 100644
--- a/src/phnc.c
+++ b/src/phnc.c
@@ -130,10 +130,11 @@ pstatus_t photorec_progressbar(WINDOW *window, const unsigned int pass, const st
(unsigned)(elapsed_time%60));
if(offset > partition->part_offset && params->status!=STATUS_EXT2_ON_BF && params->status!=STATUS_EXT2_OFF_BF)
{
+ const time_t eta=(partition->part_offset+partition->part_size-1-offset)*elapsed_time/(offset-partition->part_offset);
wprintw(window," - Estimated time to completion %uh%02um%02u\n",
- (unsigned)((partition->part_offset+partition->part_size-1-offset)*elapsed_time/(offset-partition->part_offset)/3600),
- (unsigned)(((partition->part_offset+partition->part_size-1-offset)*elapsed_time/(offset-partition->part_offset)/60)%60),
- (unsigned)((partition->part_offset+partition->part_size-1-offset)*elapsed_time/(offset-partition->part_offset))%60);
+ (unsigned)(eta/3600),
+ (unsigned)((eta/60)%60),
+ (unsigned)(eta%60));
}
}
photorec_info(window, params->file_stats);