From db02595763714c4f98861172efb5293c36e572ae Mon Sep 17 00:00:00 2001 From: Ray Lai Date: Sat, 18 Mar 2006 03:33:56 +0000 Subject: 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@ --- usr.bin/cvs/rcsnum.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'usr.bin') 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 * 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); -- cgit v1.2.3