util.datamanager: No shadowing of variable [luacheck]
authorKim Alvefur <zash@zash.se>
Fri, 11 Dec 2015 19:22:54 +0000 (20:22 +0100)
committerKim Alvefur <zash@zash.se>
Fri, 11 Dec 2015 19:22:54 +0000 (20:22 +0100)
util/datamanager.lua

index b7c514ad5b4cd15e805cbda4948138e63c88b8ac..786abd956381193c7e4b9c87093d375ebd499cd0 100644 (file)
@@ -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);