summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2005-05-30 07:28:50 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2005-05-30 07:28:50 +0000
commit4304d5f01cd6e1f1d61aa5763ce9f7a1ad96dea0 (patch)
tree2c286b58f264918548783c8f451aecdb007ed2dc
parentfc58547fd2c590d62c87a320e3378cfc85833030 (diff)
check cvs_sendarg() return value; ok joris@
-rw-r--r--usr.bin/cvs/diff.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/usr.bin/cvs/diff.c b/usr.bin/cvs/diff.c
index 38464da1748..635f3838b34 100644
--- a/usr.bin/cvs/diff.c
+++ b/usr.bin/cvs/diff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff.c,v 1.37 2005/05/27 22:41:00 joris Exp $ */
+/* $OpenBSD: diff.c,v 1.38 2005/05/30 07:28:49 xsa Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
* All rights reserved.
@@ -473,24 +473,31 @@ cvs_diff_pre_exec(struct cvsroot *root)
if (pflag && (cvs_sendarg(root, "-p", 0) < 0))
return (CVS_EX_PROTO);
- if (format == D_CONTEXT)
- cvs_sendarg(root, "-c", 0);
- else if (format == D_UNIFIED)
- cvs_sendarg(root, "-u", 0);
+ if (format == D_CONTEXT) {
+ if (cvs_sendarg(root, "-c", 0) < 0)
+ return (CVS_EX_PROTO);
+ } else if (format == D_UNIFIED) {
+ if (cvs_sendarg(root, "-u", 0) < 0)
+ return (CVS_EX_PROTO);
+ }
if (dap->rev1 != NULL) {
- cvs_sendarg(root, "-r", 0);
- cvs_sendarg(root, dap->rev1, 0);
+ if ((cvs_sendarg(root, "-r", 0) < 0) ||
+ (cvs_sendarg(root, dap->rev1, 0) < 0))
+ return (CVS_EX_PROTO);
} else if (dap->date1 != NULL) {
- cvs_sendarg(root, "-D", 0);
- cvs_sendarg(root, dap->date1, 0);
+ if ((cvs_sendarg(root, "-D", 0) < 0) ||
+ (cvs_sendarg(root, dap->date1, 0) < 0))
+ return (CVS_EX_PROTO);
}
if (dap->rev2 != NULL) {
- cvs_sendarg(root, "-r", 0);
- cvs_sendarg(root, dap->rev2, 0);
+ if ((cvs_sendarg(root, "-r", 0) < 0) ||
+ (cvs_sendarg(root, dap->rev2, 0) < 0))
+ return (CVS_EX_PROTO);
} else if (dap->date2 != NULL) {
- cvs_sendarg(root, "-D", 0);
- cvs_sendarg(root, dap->date2, 0);
+ if ((cvs_sendarg(root, "-D", 0) < 0) ||
+ (cvs_sendarg(root, dap->date2, 0) < 0))
+ return (CVS_EX_PROTO);
}
}