From 1405bb2d796e7e50be5b6fafc0127b1426d6e6bb Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Sat, 17 Sep 2005 23:47:18 +0000 Subject: fix stupidity in rcs_patch_lines() and return -1 on error so we actually catch the error instead of completely crashing. --- usr.bin/cvs/rcs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'usr.bin/cvs/rcs.c') diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index de522b8e4a4..d26ead01aaf 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.60 2005/09/05 19:25:00 xsa Exp $ */ +/* $OpenBSD: rcs.c,v 1.61 2005/09/17 23:47:17 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -1113,14 +1113,14 @@ rcs_patch_lines(struct rcs_foo *dlines, struct rcs_foo *plines) (*ep != ' ')) { cvs_log(LP_ERR, "invalid line specification in RCS patch"); - return (NULL); + return (-1); } ep++; nbln = (int)strtol(ep, &ep, 10); if ((nbln <= 0) || (*ep != '\0')) { cvs_log(LP_ERR, "invalid line number specification in RCS patch"); - return (NULL); + return (-1); } /* find the appropriate line */ @@ -1141,7 +1141,7 @@ rcs_patch_lines(struct rcs_foo *dlines, struct rcs_foo *plines) if (dlp == NULL) { cvs_log(LP_ERR, "can't find referenced line in RCS patch"); - return (NULL); + return (-1); } if (op == 'd') { -- cgit v1.2.3