diff options
author | 2005-03-05 18:43:55 +0000 | |
---|---|---|
committer | 2005-03-05 18:43:55 +0000 | |
commit | 3ca1798189cc902b143055090e4700b59fb19017 (patch) | |
tree | af9062bf766e979ab785425270d2a07d813dd853 | |
parent | add functions to retrieve and set the comment leader for an RCS (diff) | |
download | wireguard-openbsd-3ca1798189cc902b143055090e4700b59fb19017.tar.xz wireguard-openbsd-3ca1798189cc902b143055090e4700b59fb19017.zip |
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@
-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; |