diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2005-03-05 18:43:56 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2005-03-05 18:43:56 +0000 |
commit | 4d7b5118ce43c15ad8ef06951d9a21cff09bd146 (patch) | |
tree | f609433051d791aa21c5a04bb0392092e1ef2bf9 /usr.bin/cvs/import.c | |
parent | fa3a0f43c8dfa471d41a778e9e0bd0675b6d3a35 (diff) |
free bnum when we are done using it, also use rcsnum_parse() instead
of our own combination of rcsnum_alloc() and rcsnum_aton().
ok jfb@
Diffstat (limited to 'usr.bin/cvs/import.c')
-rw-r--r-- | usr.bin/cvs/import.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.bin/cvs/import.c b/usr.bin/cvs/import.c index b283af35ff3..fa38f13e020 100644 --- a/usr.bin/cvs/import.c +++ b/usr.bin/cvs/import.c @@ -1,4 +1,4 @@ -/* $OpenBSD: import.c,v 1.5 2005/02/28 20:18:02 joris Exp $ */ +/* $OpenBSD: import.c,v 1.6 2005/03/05 18:43:55 joris Exp $ */ /* * Copyright (c) 2004 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -58,7 +58,7 @@ int cvs_import(int argc, char **argv) { int ch, flags; - char *branch, *ep; + char *branch; struct cvsroot *root; RCSNUM *bnum; @@ -69,14 +69,12 @@ cvs_import(int argc, char **argv) switch (ch) { case 'b': branch = optarg; - if ((bnum = rcsnum_alloc()) == NULL) - return (-1); - if ((rcsnum_aton(branch, &ep, bnum) < 0) || - (*ep != '\0')) { + if ((bnum = rcsnum_parse(branch)) == NULL) { cvs_log(LP_ERR, "%s is not a numeric branch", branch); return (EX_USAGE); } + rcsnum_free(bnum); break; case 'd': break; |