aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorAsbjørn Sloth Tønnesen <ast@2e8.dk>2019-06-03 18:40:17 +0000
committerAsbjørn Sloth Tønnesen <ast@2e8.dk>2019-06-03 18:40:17 +0000
commit8fd0b2cbc4a6fa969b3882bdb1704d9c3ff5ff7a (patch)
tree45e31740de0ef10425b60d790acd3b6fa12e27a2 /lua
parentb38f42647b49a2c4fca3ab267f8717be3187ecdf (diff)
downloadlua-inet-8fd0b2cbc4a6fa969b3882bdb1704d9c3ff5ff7a.tar.gz
lua-inet-8fd0b2cbc4a6fa969b3882bdb1704d9c3ff5ff7a.tar.xz
lua-inet-8fd0b2cbc4a6fa969b3882bdb1704d9c3ff5ff7a.zip
fix inspectability
Signed-off-by: Asbjørn Sloth Tønnesen <ast@2e8.dk>
Diffstat (limited to 'lua')
-rw-r--r--lua/inet/init.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/lua/inet/init.lua b/lua/inet/init.lua
index 99d1195..72677f9 100644
--- a/lua/inet/init.lua
+++ b/lua/inet/init.lua
@@ -18,7 +18,9 @@ function inet.new(ip, mask)
end
function inet:__len()
- return self.mask
+ local mask = self.mask
+ if mask == nil then return 0 end -- make metatable inspectable
+ return mask
end
local lshift = bit32.lshift