summaryrefslogtreecommitdiffstats
path: root/usr.bin/rcs/rcsutil.c
diff options
context:
space:
mode:
authorniallo <niallo@openbsd.org>2007-01-11 18:13:33 +0000
committerniallo <niallo@openbsd.org>2007-01-11 18:13:33 +0000
commit41e7f8c95e79db89d202f6631c4465815526e243 (patch)
treeafb3b320c9bce2cdb4500753d0be21a7ecea7196 /usr.bin/rcs/rcsutil.c
parentsilence some warnings. (diff)
downloadwireguard-openbsd-41e7f8c95e79db89d202f6631c4465815526e243.tar.xz
wireguard-openbsd-41e7f8c95e79db89d202f6631c4465815526e243.zip
remove some un-needed buffer NUL-termination. in openrcs, diff3 is already NUL-terminating its
buffers so we don't need to do it twice. this allows us to sync rcs_splitlines() with opencvs' cvs_splitlines(). ok joris@
Diffstat (limited to 'usr.bin/rcs/rcsutil.c')
-rw-r--r--usr.bin/rcs/rcsutil.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/rcs/rcsutil.c b/usr.bin/rcs/rcsutil.c
index e9b7218570a..9210f4ed872 100644
--- a/usr.bin/rcs/rcsutil.c
+++ b/usr.bin/rcs/rcsutil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsutil.c,v 1.25 2007/01/10 02:13:23 ray Exp $ */
+/* $OpenBSD: rcsutil.c,v 1.26 2007/01/11 18:13:33 niallo Exp $ */
/*
* Copyright (c) 2005, 2006 Joris Vink <joris@openbsd.org>
* Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
@@ -492,9 +492,7 @@ rcs_splitlines(const u_char *data, size_t len)
p = c = data;
for (i = 0; i < len; i++) {
if (*p == '\n' || (i == len - 1)) {
- tlen = p - c;
- if (*p == '\n')
- tlen++;
+ tlen = p - c + 1;
lp = xmalloc(sizeof(*lp));
lp->l_line = c;
lp->l_len = tlen;