summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzinovik <zinovik@cvs.openbsd.org>2010-03-30 16:56:33 +0000
committerzinovik <zinovik@cvs.openbsd.org>2010-03-30 16:56:33 +0000
commit1e43324a1250a9a2ba1ae3f31e7a7b05fb04ca06 (patch)
treea1a2a154d1126377438f516df93d554d65fbb661
parent11e37ec28dcf4e1ebfb9af144b774760fab88a2f (diff)
This diff synchronizes rcs parser code with OpenRCS. It shrinks code by 3
lines, but does exactly the same thing. It also removes unneeded variable `buf' ok deraadt@, xsa@
-rw-r--r--usr.bin/cvs/rcs.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c
index d1497948df5..6b7435abe43 100644
--- a/usr.bin/cvs/rcs.c
+++ b/usr.bin/cvs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.291 2009/06/07 08:39:13 ray Exp $ */
+/* $OpenBSD: rcs.c,v 1.292 2010/03/30 16:56:32 zinovik Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -366,7 +366,7 @@ void
rcs_write(RCSFILE *rfp)
{
FILE *fp;
- char buf[1024], numbuf[CVS_REV_BUFSZ], *fn, tmpdir[MAXPATHLEN];
+ char numbuf[CVS_REV_BUFSZ], *fn, tmpdir[MAXPATHLEN];
struct rcs_access *ap;
struct rcs_sym *symp;
struct rcs_branch *brp;
@@ -424,11 +424,7 @@ rcs_write(RCSFILE *rfp)
if (RCSNUM_ISBRANCH(symp->rs_num))
rcsnum_addmagic(symp->rs_num);
rcsnum_tostr(symp->rs_num, numbuf, sizeof(numbuf));
- if (strlcpy(buf, symp->rs_name, sizeof(buf)) >= sizeof(buf) ||
- strlcat(buf, ":", sizeof(buf)) >= sizeof(buf) ||
- strlcat(buf, numbuf, sizeof(buf)) >= sizeof(buf))
- fatal("rcs_write: string overflow");
- fprintf(fp, "\n\t%s", buf);
+ fprintf(fp, "\n\t%s:%s", symp->rs_name, numbuf);
}
fprintf(fp, ";\n");