summaryrefslogtreecommitdiff
path: root/usr.bin/cvs
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2007-05-02 15:50:11 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2007-05-02 15:50:11 +0000
commit210e4ba22b395cb05d8d8b57a9a03f72daa68e34 (patch)
tree13a1eb76f06dffdbf372a78109d0e64765c40263 /usr.bin/cvs
parent25d5641f85cbea8489a50c2a91558e7e3b4cb406 (diff)
strtol() -> strtonum(); from Tobias Stoeckmann.
OK ray@ otto@.
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r--usr.bin/cvs/root.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/cvs/root.c b/usr.bin/cvs/root.c
index cf3b38af776..d87ed2073cb 100644
--- a/usr.bin/cvs/root.c
+++ b/usr.bin/cvs/root.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: root.c,v 1.36 2007/02/22 06:42:09 otto Exp $ */
+/* $OpenBSD: root.c,v 1.37 2007/05/02 15:50:10 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -73,6 +73,7 @@ cvsroot_parse(const char *str)
{
u_int i;
char *cp, *sp, *pp;
+ const char *errstr;
struct cvsroot *root;
/*
@@ -156,9 +157,9 @@ cvsroot_parse(const char *str)
pp = strchr(sp, ':');
if (pp != NULL) {
*(pp++) = '\0';
- root->cr_port = (u_int)strtol(pp, &cp, 10);
- if ((*cp != '\0') || (root->cr_port > 65535))
- fatal("invalid port specification in CVSROOT");
+ root->cr_port = strtonum(pp, 1, 65535, &errstr);
+ if (errstr != NULL)
+ fatal("port specification in CVSROOT is %s", errstr);
}