summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/rcs.c
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-09-17 23:47:18 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-09-17 23:47:18 +0000
commit1405bb2d796e7e50be5b6fafc0127b1426d6e6bb (patch)
tree299e33db3b13c20cbee1aacaa4ef3dc629bb20e9 /usr.bin/cvs/rcs.c
parent1fd815574623a77dd7ad0c0d98b064dcd4003e15 (diff)
fix stupidity in rcs_patch_lines() and return -1 on error so we actually
catch the error instead of completely crashing.
Diffstat (limited to 'usr.bin/cvs/rcs.c')
-rw-r--r--usr.bin/cvs/rcs.c8
1 files changed, 4 insertions, 4 deletions
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 <jfb@openbsd.org>
* 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') {