From 19604ca8a0ee0094c1d72578ba07f808637a8970 Mon Sep 17 00:00:00 2001 From: niko Date: Fri, 25 Nov 2011 18:00:27 +0100 Subject: [PATCH] [net] fix division by zero --- widgets/net.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgets/net.lua b/widgets/net.lua index 59ac52d..b8a270c 100644 --- a/widgets/net.lua +++ b/widgets/net.lua @@ -55,7 +55,7 @@ local function worker(format) helpers.uformat(args, name .. " up", 0, unit) else -- Net stats are absolute, substract our last reading local interval = now - nets[name].time - if interval < 0 then interval = 1 end + if interval <= 0 then interval = 1 end local down = (recv - nets[name][1]) / interval local up = (send - nets[name][2]) / interval