fix ipcalc output
authorMike Baker <mbm@openwrt.org>
Fri, 24 Mar 2006 14:21:48 +0000 (14:21 +0000)
committerMike Baker <mbm@openwrt.org>
Fri, 24 Mar 2006 14:21:48 +0000 (14:21 +0000)
SVN-Revision: 3473

openwrt/package/base-files/default/usr/lib/common.awk

index 250a70f6416695efed9d660e3f383c7e28845e18..a9ab0f1645ac980330593f40cc7edddb394904fc 100644 (file)
@@ -58,9 +58,9 @@ function ip2int(ip) {
        return ret
 }
 
-function int2ip(ip,ret) {
+function int2ip(ip,ret,x) {
        ret=and(ip,255)
        ip=rshift(ip,8)
-       for(;ip;ret=and(ip,255)"."ret,ip=rshift(ip,8));
+       for(x<3;ret=and(ip,255)"."ret,ip=rshift(ip,8),x++)
        return ret
 }