diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2005-10-09 16:14:24 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2005-10-09 16:14:24 +0000 |
commit | fa9cff48236fd7211f7efb76a88b68bd8576c872 (patch) | |
tree | 61c4874304f02b328127105a37db14e9692bd386 | |
parent | 518cd16d0060e3ce676cfa6f42e3d20e9aec5eaa (diff) |
fix 2 off-by-one's which was causing us a whole load of crap;
ok niallo@
-rw-r--r-- | usr.bin/cvs/rcs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index b7bf27193a7..4d711559e8d 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.81 2005/10/07 23:59:56 niallo Exp $ */ +/* $OpenBSD: rcs.c,v 1.82 2005/10/09 16:14:23 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -1241,7 +1241,7 @@ rcs_patch_lines(struct rcs_foo *dlines, struct rcs_foo *plines) lp = TAILQ_NEXT(lp, rl_list)) { op = *(lp->rl_line); lineno = (int)strtol((lp->rl_line + 1), &ep, 10); - if ((lineno > dlines->rl_nblines) || (lineno <= 0) || + if ((lineno > dlines->rl_nblines) || (lineno < 0) || (*ep != ' ')) { cvs_log(LP_ERR, "invalid line specification in RCS patch"); @@ -1249,7 +1249,7 @@ rcs_patch_lines(struct rcs_foo *dlines, struct rcs_foo *plines) } ep++; nbln = (int)strtol(ep, &ep, 10); - if ((nbln <= 0) || (*ep != '\0')) { + if ((nbln < 0) || (*ep != '\0')) { cvs_log(LP_ERR, "invalid line number specification in RCS patch"); return (-1); |