diff options
author | Kim Alvefur <zash@zash.se> | 2016-07-13 10:25:52 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-07-13 10:25:52 +0200 |
commit | 6aab36d1ad11b6ba9fe66ecbf540028921e745fc (patch) | |
tree | 211c2095c4ed506159c6508b1a901ac0ac56af38 /util/ip.lua | |
parent | 4616176276adc08c8ed2379bca0fada582d0cda5 (diff) | |
parent | d76cafb53946682bc1034c872bccca4f28b6696e (diff) | |
download | prosody-6aab36d1ad11b6ba9fe66ecbf540028921e745fc.tar.gz prosody-6aab36d1ad11b6ba9fe66ecbf540028921e745fc.zip |
Merge 0.10->trunk
Diffstat (limited to 'util/ip.lua')
-rw-r--r-- | util/ip.lua | 8 |
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 |