summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorray <ray@openbsd.org>2006-03-18 03:33:55 +0000
committerray <ray@openbsd.org>2006-03-18 03:33:55 +0000
commit4060a934f1ee4b79a32a35d68f5bfff4378c05da (patch)
treed7d25cb6ff5a0957340edf7996d32ab61ab71450
parentuse polling for the synchronise command while i move the xs setup and (diff)
downloadwireguard-openbsd-4060a934f1ee4b79a32a35d68f5bfff4378c05da.tar.xz
wireguard-openbsd-4060a934f1ee4b79a32a35d68f5bfff4378c05da.zip
Change code to match comments, fixing potential off-by-one error.
According to the comments, the lowest number should be 1. not okay, then okay niallo@
-rw-r--r--usr.bin/cvs/rcsnum.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/cvs/rcsnum.c b/usr.bin/cvs/rcsnum.c
index 94a8a95c927..86f8b1811a7 100644
--- a/usr.bin/cvs/rcsnum.c
+++ b/usr.bin/cvs/rcsnum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsnum.c,v 1.27 2006/03/15 05:05:35 deraadt Exp $ */
+/* $OpenBSD: rcsnum.c,v 1.28 2006/03/18 03:33:55 ray Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -341,7 +341,8 @@ rcsnum_inc(RCSNUM *num)
RCSNUM *
rcsnum_dec(RCSNUM *num)
{
- if (num->rn_id[num->rn_len - 1] <= 0)
+ /* XXX - Is it an error for the number to be 0? */
+ if (num->rn_id[num->rn_len - 1] <= 1)
return (num);
num->rn_id[num->rn_len - 1]--;
return (num);