aboutsummaryrefslogtreecommitdiffstats
path: root/examples/plugins/df
diff options
context:
space:
mode:
Diffstat (limited to 'examples/plugins/df')
-rw-r--r--examples/plugins/df2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/plugins/df b/examples/plugins/df
index d6c257f..5b3926b 100644
--- a/examples/plugins/df
+++ b/examples/plugins/df
@@ -58,7 +58,7 @@ def redraw():
def u(b):
unit = 0
units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB']
- while (unit < len(units)) and (b >= 1024):
+ while (unit + 1 < len(units)) and (b >= 1024):
b /= 1024
unit += 1
return '%7.2f%s' % (b, units[unit])