diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2006-08-04 06:13:55 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2006-08-04 06:13:55 +0000 |
commit | 615c7371fba3add0efd3d774372730e78579d1a1 (patch) | |
tree | 334f4fb017c745271831b1a337c29fde5be8dcc6 /usr.bin | |
parent | bfdbbca5b52fa67a89069ffb7ea02747939cc460 (diff) |
Remove unnecessary strlcpy/strlcat.
``Oh man!'' xsa@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/rcs/rcs.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.bin/rcs/rcs.c b/usr.bin/rcs/rcs.c index 251eb83df0b..7817bdb8851 100644 --- a/usr.bin/rcs/rcs.c +++ b/usr.bin/rcs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.29 2006/07/28 05:41:45 ray Exp $ */ +/* $OpenBSD: rcs.c,v 1.30 2006/08/04 06:13:54 ray Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -358,7 +358,7 @@ void rcs_write(RCSFILE *rfp) { FILE *fp; - char buf[1024], numbuf[64], *fn; + char numbuf[64], *fn; struct rcs_access *ap; struct rcs_sym *symp; struct rcs_branch *brp; @@ -411,11 +411,7 @@ rcs_write(RCSFILE *rfp) fprintf(fp, "symbols"); TAILQ_FOREACH(symp, &(rfp->rf_symbols), rs_list) { 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)) - errx(1, "rcs_write: string overflow"); - fprintf(fp, "\n\t%s", buf); + fprintf(fp, "\n\t%s:%s", symp->rs_name, numbuf); } fprintf(fp, ";\n"); |