diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2007-02-09 03:30:32 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2007-02-09 03:30:32 +0000 |
commit | 3dd8993c39f938c0bd43a26121ba69f61e531868 (patch) | |
tree | 46171204e4be0b947ddb7b367cbfa97972462c67 /usr.bin/cvs | |
parent | 20751818273f6bdeb69e621fa8a83408b36161a2 (diff) |
strtol(3) -> strtonum(3)
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/cvs.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/cvs/cvs.c b/usr.bin/cvs/cvs.c index 1c529383d09..e866837f4a7 100644 --- a/usr.bin/cvs/cvs.c +++ b/usr.bin/cvs/cvs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.c,v 1.114 2007/02/06 15:24:18 jmc Exp $ */ +/* $OpenBSD: cvs.c,v 1.115 2007/02/09 03:30:31 joris Exp $ */ /* * Copyright (c) 2006, 2007 Joris Vink <joris@openbsd.org> * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> @@ -290,6 +290,7 @@ cvs_getopt(int argc, char **argv) { int ret; char *ep; + const char *errstr; while ((ret = getopt(argc, argv, "b:d:e:fHlnQqRrs:T:tvVwz:")) != -1) { switch (ret) { @@ -367,12 +368,9 @@ cvs_getopt(int argc, char **argv) */ break; case 'z': - cvs_compress = (int)strtol(optarg, &ep, 10); - if (*ep != '\0') - fatal("error parsing compression level"); - if (cvs_compress < 0 || cvs_compress > 9) - fatal("gzip compression level must be " - "between 0 and 9"); + cvs_compress = strtonum(optarg, 0, 9, &errstr); + if (errstr != NULL) + fatal("cvs_compress: %s", errstr); break; default: usage(); |