aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-12-11 20:22:54 +0100
committerKim Alvefur <zash@zash.se>2015-12-11 20:22:54 +0100
commit74500e9b505da0bee52b7f03d3372b90a09c5b50 (patch)
treebee7491da3329bc2de0b37558e56fd0089567bf1
parent74caca930a0fffb2975a1043d2d5033a9c9647ef (diff)
downloadprosody-74500e9b505da0bee52b7f03d3372b90a09c5b50.tar.gz
prosody-74500e9b505da0bee52b7f03d3372b90a09c5b50.zip
util.datamanager: No shadowing of variable [luacheck]
-rw-r--r--util/datamanager.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua
index b7c514ad..786abd95 100644
--- a/util/datamanager.lua
+++ b/util/datamanager.lua
@@ -211,6 +211,8 @@ end
local function append(username, host, datastore, ext, data)
local filename = getpath(username, host, datastore, ext, true);
+
+ local ok;
local f, msg = io_open(filename, "r+");
if not f then
f, msg = io_open(filename, "w");
@@ -219,7 +221,7 @@ local function append(username, host, datastore, ext, data)
end
end
local pos = f:seek("end");
- local ok, msg = fallocate(f, pos, #data);
+ ok, msg = fallocate(f, pos, #data);
f:seek("set", pos);
if ok then
f:write(data);