diff options
author | Theodore Ts'o <tytso@mit.edu> | 2000-08-08 03:17:04 +0000 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2000-08-08 03:17:04 +0000 |
commit | b8d164cd2412edc65ba47c573f2abcc254dbbbc9 (patch) | |
tree | db019b6b54dd39ae6c0acee8ce6f59e896d0f334 /e2fsck | |
parent | c786fec3f52cd615cc535d35185a5e0ffcb7cc55 (diff) | |
download | e2fsprogs-b8d164cd2412edc65ba47c573f2abcc254dbbbc9.tar.gz |
ChangeLog, unix.c:
unix.c (calc_percent): Make sure that we don't take a floating
exception if the max value is zero. (should normally never happen,
but...)
Diffstat (limited to 'e2fsck')
-rw-r--r-- | e2fsck/ChangeLog | 6 | ||||
-rw-r--r-- | e2fsck/unix.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index af145f9d..2c4efaab 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,9 @@ +2000-08-07 <tytso@snap.thunk.org> + + * unix.c (calc_percent): Make sure that we don't take a floating + exception if the max value is zero. (should normally + never happen, but...) + 2000-07-13 <tytso@valinux.com> * Release of E2fsprogs 1.19 diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 95034717..71a321c0 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -305,7 +305,7 @@ static float calc_percent(struct percent_tbl *tbl, int pass, int curr, if (pass <= 0) return 0.0; - if (pass > tbl->max_pass) + if (pass > tbl->max_pass || max == 0) return 100.0; percent = ((float) curr) / ((float) max); return ((percent * (tbl->table[pass] - tbl->table[pass-1])) |