summaryrefslogtreecommitdiff
path: root/usr.bin/ftp
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2007-04-07 23:20:20 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2007-04-07 23:20:20 +0000
commit9f94e9d55e37418c5d78c0f9926aa6673f1fa779 (patch)
treece11e43f274a1a9ddcf81d95272402d889978d83 /usr.bin/ftp
parentc6b764f7a9d018ac40e2d03f931cea130b13d8ae (diff)
use strtonum, from jason dixon
Diffstat (limited to 'usr.bin/ftp')
-rw-r--r--usr.bin/ftp/main.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c
index 51590c9ed7c..708e929971b 100644
--- a/usr.bin/ftp/main.c
+++ b/usr.bin/ftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.61 2006/05/16 16:20:42 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.62 2007/04/07 23:20:18 tedu Exp $ */
/* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */
/*
@@ -66,7 +66,7 @@ static const char copyright[] =
#endif /* not lint */
#if !defined(lint) && !defined(SMALL)
-static const char rcsid[] = "$OpenBSD: main.c,v 1.61 2006/05/16 16:20:42 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: main.c,v 1.62 2007/04/07 23:20:18 tedu Exp $";
#endif /* not lint and not SMALL */
/*
@@ -96,6 +96,7 @@ main(volatile int argc, char *argv[])
struct passwd *pw = NULL;
char *cp, homedir[MAXPATHLEN];
char *outfile = NULL;
+ const char *errstr;
int dumb_terminal = 0;
ftpport = "ftp";
@@ -239,10 +240,10 @@ main(volatile int argc, char *argv[])
break;
case 'r':
- if (isdigit(*optarg))
- retry_connect = atoi(optarg);
- else
- errx(1, "-r requires numeric argument");
+ retry_connect = strtonum(optarg, 0, INT_MAX, &errstr);
+ if (errstr != NULL)
+ errx(1, "retry amount is %s: %s", errstr,
+ optarg);
break;
case 't':