diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2006-03-18 03:33:56 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2006-03-18 03:33:56 +0000 |
commit | db02595763714c4f98861172efb5293c36e572ae (patch) | |
tree | 4c66a7c69f79c718075fd64e3ee3fd97b9948098 /usr.bin | |
parent | 443de9a991a760206bf9e462bc9bf3df4b1e343d (diff) |
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@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cvs/rcsnum.c | 5 |
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); |