diff options
author | Rob Landley <rob@landley.net> | 2013-11-28 21:11:34 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2013-11-28 21:11:34 -0600 |
commit | b5e74165d1462d69deaecbf14305dbf2eee746d5 (patch) | |
tree | 039b23d58a1316bd69fcb68b4743800451c34fb9 /lib/lib.c | |
parent | 5ec4ab3113dcc813b6040d7ded38e297df99dc0e (diff) | |
download | toybox-b5e74165d1462d69deaecbf14305dbf2eee746d5.tar.gz |
Oops, cleaned up ifconfig uses atolx_range() instead of get_int_list(). Check that in.
Diffstat (limited to 'lib/lib.c')
-rw-r--r-- | lib/lib.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -203,6 +203,16 @@ long atolx(char *numstr) return val; } +long atolx_range(char *numstr, long low, long high) +{ + long val = atolx(numstr); + + if (val < low) error_exit("%ld < %ld", val, low); + if (val > high) error_exit("%ld > %ld", val, high); + + return val; +} + int numlen(long l) { int len = 0; |