diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-10-11 16:07:41 +0200 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-10-11 16:09:02 +0200 |
commit | 114d43de5b67ede0075aa3cd0b8c8c90bcbfed98 (patch) | |
tree | cb700c0184a8c759a4303d9f6d17ad3406bc19f9 | |
parent | bd6fe0b3faded57e4b01045e207ec179dca9accf (diff) | |
download | vicious-legacy-114d43de5b67ede0075aa3cd0b8c8c90bcbfed98.tar.xz |
uptime: fixed problem discovered by jabbas
-rw-r--r-- | uptime.lua | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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) |