From 353e651454a741f7b4b9c1b80f23e479ff237e67 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Sat, 21 May 2016 13:01:39 +0100 Subject: [PATCH] ipnames.save_data: Use os.time() for incorrect table value --- functions.lua | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/functions.lua b/functions.lua index 2562c02..f74a7e8 100644 --- a/functions.lua +++ b/functions.lua @@ -82,11 +82,8 @@ function ipnames.save_data() ipnames.changes = false local file = io.open(ipnames.file, "w") for k, v in pairs(ipnames.data) do - if v[2] > 0 then - file:write(k.."|"..v[1].."|"..v[2].."\n") - else - file:write(k.."|"..v[1].."\n") - end + v[2] = v[2] or os.time() + file:write(k.."|"..v[1].."|"..v[2].."\n") end io.close(file) end @@ -111,4 +108,4 @@ function ipnames.save_whitelist() end end io.close(file) -end \ No newline at end of file +end