Skip to content

Commit

Permalink
ipnames.save_data: Use os.time() for incorrect table value
Browse files Browse the repository at this point in the history
  • Loading branch information
tenplus1 authored and SmallJoker committed May 21, 2016
1 parent e1c2c99 commit 353e651
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions functions.lua
Expand Up @@ -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
Expand All @@ -111,4 +108,4 @@ function ipnames.save_whitelist()
end
end
io.close(file)
end
end

0 comments on commit 353e651

Please sign in to comment.