aboutsummaryrefslogtreecommitdiffstats
path: root/examples/plugins/network
diff options
context:
space:
mode:
Diffstat (limited to 'examples/plugins/network')
-rw-r--r--examples/plugins/network2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/plugins/network b/examples/plugins/network
index cdcbcee..0431bb9 100644
--- a/examples/plugins/network
+++ b/examples/plugins/network
@@ -79,7 +79,7 @@ def redraw():
def u(b):
unit = 0
units = ['', 'K', 'M', 'G', 'T', 'P', 'E']
- while (unit < len(units)) and (b >= 1024):
+ while (unit + 1 < len(units)) and (b >= 1024):
b /= 1024
unit += 1
return '%.0f%s' % (b, units[unit])