[net] fix division by zero

This commit is contained in:
niko 2011-11-25 18:00:27 +01:00 committed by J. Thalheim
parent 541cc90a0c
commit 19604ca8a0
1 changed files with 1 additions and 1 deletions

View File

@ -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