aboutsummaryrefslogtreecommitdiff
path: root/uptime.lua
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2009-10-11 16:07:41 +0200
committerAdrian C. (anrxc) <anrxc@sysphere.org>2009-10-11 16:07:41 +0200
commit7f3d31e0cb8cdf18ee0d3c96e54fdbd0a7bcca17 (patch)
tree72648f4326e6be66a574916ff7fd4f6781f35efd /uptime.lua
parent65e57fa9bf141a25afc5fa8d272ea78bc97d61ed (diff)
downloadvicious-legacy-7f3d31e0cb8cdf18ee0d3c96e54fdbd0a7bcca17.tar.xz
uptime: fixed problem discovered by jabbas
Diffstat (limited to 'uptime.lua')
-rw-r--r--uptime.lua3
1 files changed, 1 insertions, 2 deletions
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)