Whamcloud - gitweb
ChangeLog, unix.c:
authorTheodore Ts'o <tytso@mit.edu>
Tue, 8 Aug 2000 03:17:04 +0000 (03:17 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 8 Aug 2000 03:17:04 +0000 (03:17 +0000)
  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...)

e2fsck/ChangeLog
e2fsck/unix.c

index af145f9..2c4efaa 100644 (file)
@@ -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
index 9503471..71a321c 100644 (file)
@@ -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]))