* luci/libs: fix off-by-one bug in luci.ip
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 8 Aug 2008 12:55:57 +0000 (12:55 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 8 Aug 2008 12:55:57 +0000 (12:55 +0000)
libs/core/luasrc/ip.lua

index e6de08f1b2c463db53cbdaf5bcc3bb1d69f03c11..2fe71297d9bcc6c5acc17f040faa95e2bbff28c0 100644 (file)
@@ -333,7 +333,7 @@ function cidr.network( self, bits )
        if #data < #self[2] then
                table.insert( data, bit.band( self[2][1+#data], __mask16(bits) ) )
 
-               for i = #data, #self[2] do
+               for i = #data + 1, #self[2] do
                        table.insert( data, 0 )
                end
        end