aboutsummaryrefslogtreecommitdiffstats
path: root/util/ip.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-07-13 10:25:52 +0200
committerKim Alvefur <zash@zash.se>2016-07-13 10:25:52 +0200
commit21898f125205e79455e4e4539988e42a4d935b18 (patch)
tree211c2095c4ed506159c6508b1a901ac0ac56af38 /util/ip.lua
parent609cd70a7c4ab80fad47a77a32c7d70fda8779ae (diff)
parenta8523999b65f39d8a8a242f38bc825a5a6accd4d (diff)
downloadprosody-21898f125205e79455e4e4539988e42a4d935b18.tar.gz
prosody-21898f125205e79455e4e4539988e42a4d935b18.zip
Merge 0.10->trunk
Diffstat (limited to 'util/ip.lua')
-rw-r--r--util/ip.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/ip.lua b/util/ip.lua
index ec3b4d7e..81a98ef7 100644
--- a/util/ip.lua
+++ b/util/ip.lua
@@ -51,15 +51,15 @@ local function toBits(ip)
if not ip:match(":$") then fields[#fields] = nil; end
for i, field in ipairs(fields) do
if field:len() == 0 and i ~= 1 and i ~= #fields then
- for i = 1, 16 * (9 - #fields) do
+ for _ = 1, 16 * (9 - #fields) do
result = result .. "0";
end
else
- for i = 1, 4 - field:len() do
+ for _ = 1, 4 - field:len() do
result = result .. "0000";
end
- for i = 1, field:len() do
- result = result .. hex2bits[field:sub(i,i)];
+ for j = 1, field:len() do
+ result = result .. hex2bits[field:sub(j, j)];
end
end
end