summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2006-07-28 05:41:46 +0000
committerRay Lai <ray@cvs.openbsd.org>2006-07-28 05:41:46 +0000
commit1dd34a3f1258c43e8d25600adfa3dfa38ae22438 (patch)
treeceb0a753123c2d638fb01a7fc1d637263bb52f20 /usr.bin
parentc73f780b2c91fa61cafdc5ad8c663aeb28ef8434 (diff)
Recalculate buffer length after each expansion.
OK niallo@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/rcs/rcs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/rcs/rcs.c b/usr.bin/rcs/rcs.c
index 98e8adde2bf..251eb83df0b 100644
--- a/usr.bin/rcs/rcs.c
+++ b/usr.bin/rcs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.28 2006/07/27 04:23:37 ray Exp $ */
+/* $OpenBSD: rcs.c,v 1.29 2006/07/28 05:41:45 ray Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -2755,6 +2755,8 @@ rcs_expand_keywords(char *rcsfile, struct rcs_delta *rdp, BUF *bp, int mode)
((unsigned char *)rcs_buf_get(newbuf) + rcs_buf_len(newbuf)) - end);
/* Point fin to end of data. */
fin = rcs_buf_get(tmpbuf) + rcs_buf_len(tmpbuf) - 1;
+ /* Recalculate new length. */
+ len = rcs_buf_len(tmpbuf);
/* tmpbuf is now ready, free old newbuf if allocated here. */
if (newbuf != bp)