summaryrefslogtreecommitdiff
path: root/networking/ipcalc.c
diff options
context:
space:
mode:
authorEric Andersen2004-03-06 22:11:45 +0000
committerEric Andersen2004-03-06 22:11:45 +0000
commit2479445562a9b5a9f226d0b00c41dbd533e63213 (patch)
treee4891420283c085d688683a41cc217dc896917b8 /networking/ipcalc.c
parentc4db0833a6c91dd3714bec1db076a80910af6e30 (diff)
downloadbusybox-2479445562a9b5a9f226d0b00c41dbd533e63213.zip
busybox-2479445562a9b5a9f226d0b00c41dbd533e63213.tar.gz
Fix/eliminate use of atol
Diffstat (limited to 'networking/ipcalc.c')
-rw-r--r--networking/ipcalc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/networking/ipcalc.c b/networking/ipcalc.c
index 2f1c02b..d75c883 100644
--- a/networking/ipcalc.c
+++ b/networking/ipcalc.c
@@ -119,8 +119,7 @@ int ipcalc_main(int argc, char **argv)
if (*prefixstr) {
unsigned int msk;
- netprefix = atol(prefixstr);
- if (netprefix > 32) {
+ if (safe_strtoul(prefixstr, &netprefix) || netprefix > 32) {
IPCALC_MSG(bb_error_msg_and_die("bad IP prefix: %s\n", prefixstr),
exit(EXIT_FAILURE));
}