Skip to content

Commit

Permalink
Merge pull request #1254 from magnumripper/close_1242
Browse files Browse the repository at this point in the history
Close #1242
  • Loading branch information
magnumripper committed May 3, 2015
2 parents 987c571 + f86167a commit fe2b992
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pp.c
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,10 @@ static double get_progress(void)
mpf_init(fpos); mpf_init(perc);

mpf_set_z(fpos, rec_pos);
mpf_div(perc, fpos, count);
if ((double)0 == count)
perc = 0;
else
mpf_div(perc, fpos, count);
progress = 100.0 * mpf_get_d(perc);

mpf_clear(fpos); mpf_clear(perc);
Expand Down

0 comments on commit fe2b992

Please sign in to comment.