From 7f3d31e0cb8cdf18ee0d3c96e54fdbd0a7bcca17 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Sun, 11 Oct 2009 16:07:41 +0200 Subject: uptime: fixed problem discovered by jabbas --- uptime.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'uptime.lua') diff --git a/uptime.lua b/uptime.lua index 712bb14..fc12707 100644 --- a/uptime.lua +++ b/uptime.lua @@ -5,7 +5,6 @@ --------------------------------------------------- -- {{{ Grab environment -local tonumber = tonumber local io = { open = io.open } local setmetatable = setmetatable local math = { floor = math.floor } @@ -24,7 +23,7 @@ local function worker(format) local line = f:read("*line") f:close() - local up_t = math.floor(tonumber(string.match(line, "[%d%.]+"))) + local up_t = math.floor(string.match(line, "[%d]+")) local up_d = math.floor(up_t / (3600 * 24)) local up_h = math.floor((up_t % (3600 * 24)) / 3600) local up_m = math.floor(((up_t % (3600 * 24)) % 3600) / 60) -- cgit v1.2.3