summaryrefslogtreecommitdiff
path: root/usr.bin/rcs
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2007-12-09 14:02:57 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2007-12-09 14:02:57 +0000
commit104462357a853cdabf7a3a569246825fcbef02aa (patch)
treeda604988440a422b4f8133f3b39855117000ab24 /usr.bin/rcs
parent83cb0944e7feb60904f8b3d60745f266644a6012 (diff)
Fix for an off-by-one.
OK fgsch@
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r--usr.bin/rcs/rcsnum.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/rcs/rcsnum.c b/usr.bin/rcs/rcsnum.c
index a3eb31987be..d2c94df61b2 100644
--- a/usr.bin/rcs/rcsnum.c
+++ b/usr.bin/rcs/rcsnum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsnum.c,v 1.7 2007/05/29 00:19:10 ray Exp $ */
+/* $OpenBSD: rcsnum.c,v 1.8 2007/12/09 14:02:56 tobias Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -295,10 +295,10 @@ rcsnum_aton(const char *str, char **ep, RCSNUM *nump)
/* We can't have a single-digit rcs number. */
if (nump->rn_len == 0) {
+ nump->rn_len++;
nump->rn_id = xrealloc(nump->rn_id,
nump->rn_len + 1, sizeof(*(nump->rn_id)));
- nump->rn_id[nump->rn_len + 1] = 0;
- nump->rn_len++;
+ nump->rn_id[nump->rn_len] = 0;
}
nump->rn_len++;