From 1dd34a3f1258c43e8d25600adfa3dfa38ae22438 Mon Sep 17 00:00:00 2001 From: Ray Lai Date: Fri, 28 Jul 2006 05:41:46 +0000 Subject: Recalculate buffer length after each expansion. OK niallo@ --- usr.bin/rcs/rcs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'usr.bin') 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 * 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) -- cgit v1.2.3