Software /
code /
prosody
Diff
util/datamanager.lua @ 6996:644b1bddc676
util.datamanager: No shadowing of variable [luacheck]
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 11 Dec 2015 20:22:54 +0100 |
parent | 6995:807b0b2ee545 |
child | 6997:0ab228bc21c6 |
line wrap: on
line diff
--- a/util/datamanager.lua Fri Dec 11 20:18:24 2015 +0100 +++ b/util/datamanager.lua Fri Dec 11 20:22:54 2015 +0100 @@ -211,6 +211,8 @@ 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 @@ 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);