Skip to content

Commit

Permalink
Close #1242
Browse files Browse the repository at this point in the history
  • Loading branch information
loverszhaokai committed May 2, 2015
1 parent 987c571 commit f86167a
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 f86167a

Please sign in to comment.