diff options
author | Denis Vlasenko | 2006-10-08 12:49:22 +0000 |
---|---|---|
committer | Denis Vlasenko | 2006-10-08 12:49:22 +0000 |
commit | 1385899416a4396385ad421ae1f532be7103738a (patch) | |
tree | fc4d14a910593d1235318bb36abe5e9f72d2039e /networking/route.c | |
parent | 5625415085e68ac5e150f54e685417c866620d76 (diff) | |
download | busybox-1385899416a4396385ad421ae1f532be7103738a.zip busybox-1385899416a4396385ad421ae1f532be7103738a.tar.gz |
attempt to regularize atoi mess.
Diffstat (limited to 'networking/route.c')
-rw-r--r-- | networking/route.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/networking/route.c b/networking/route.c index 2e6e017..65b40fc 100644 --- a/networking/route.c +++ b/networking/route.c @@ -178,7 +178,7 @@ static void INET_setroute(int action, char **args) if(prefix) { int prefix_len; - prefix_len = bb_xgetularg10_bnd(prefix+1, 0, 32); + prefix_len = xatoul_range(prefix+1, 0, 32); mask_in_addr(rt) = htonl( ~ (0xffffffffUL >> prefix_len)); *prefix = '\0'; #if HAVE_NEW_ADDRT @@ -218,7 +218,7 @@ static void INET_setroute(int action, char **args) #if HAVE_NEW_ADDRT if (k == KW_IPVx_METRIC) { - rt.rt_metric = bb_xgetularg10(args_m1) + 1; + rt.rt_metric = xatoul(args_m1) + 1; continue; } #endif @@ -259,20 +259,20 @@ static void INET_setroute(int action, char **args) if (k == KW_IPVx_MSS) { /* Check valid MSS bounds. */ rt.rt_flags |= RTF_MSS; - rt.rt_mss = bb_xgetularg10_bnd(args_m1, 64, 32768); + rt.rt_mss = xatoul_range(args_m1, 64, 32768); continue; } if (k == KW_IPVx_WINDOW) { /* Check valid window bounds. */ rt.rt_flags |= RTF_WINDOW; - rt.rt_window = bb_xgetularg10_bnd(args_m1, 128, INT_MAX); + rt.rt_window = xatoul_range(args_m1, 128, INT_MAX); continue; } #ifdef RTF_IRTT if (k == KW_IPVx_IRTT) { rt.rt_flags |= RTF_IRTT; - rt.rt_irtt = bb_xgetularg10(args_m1); + rt.rt_irtt = xatoul(args_m1); rt.rt_irtt *= (sysconf(_SC_CLK_TCK) / 100); /* FIXME */ #if 0 /* FIXME: do we need to check anything of this? */ if (rt.rt_irtt < 1 || rt.rt_irtt > (120 * HZ)) { @@ -353,7 +353,7 @@ static void INET6_setroute(int action, char **args) char *cp; if ((cp = strchr(target, '/'))) { /* Yes... const to non is ok. */ *cp = 0; - prefix_len = bb_xgetularg10_bnd(cp+1, 0, 128); + prefix_len = xatoul_range(cp+1, 0, 128); } else { prefix_len = 128; } @@ -384,7 +384,7 @@ static void INET6_setroute(int action, char **args) } if (k == KW_IPVx_METRIC) { - rt.rtmsg_metric = bb_xgetularg10(args_m1); + rt.rtmsg_metric = xatoul(args_m1); continue; } |