summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/history.c
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2005-01-31 22:04:59 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2005-01-31 22:04:59 +0000
commitd3bd0af858d3c49891e90c22bdf2ccf006d8ab55 (patch)
treeda18272830efa22d46ce444397dcf8c38c81abba /usr.bin/cvs/history.c
parentb0b0ab3bf902ebb28c695f2ee2b6992467b22ee3 (diff)
perform error checking on all the protocol calls
Diffstat (limited to 'usr.bin/cvs/history.c')
-rw-r--r--usr.bin/cvs/history.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/usr.bin/cvs/history.c b/usr.bin/cvs/history.c
index 72ae42783cd..6b424e55061 100644
--- a/usr.bin/cvs/history.c
+++ b/usr.bin/cvs/history.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: history.c,v 1.6 2005/01/31 21:46:43 jfb Exp $ */
+/* $OpenBSD: history.c,v 1.7 2005/01/31 22:04:58 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -166,25 +166,29 @@ cvs_history(int argc, char **argv)
}
cvs_hist_close(hp);
} else {
- if (flags & CVS_HF_C)
- cvs_sendarg(root, "-c", 0);
+ if ((flags & CVS_HF_C) && (cvs_sendarg(root, "-c", 0) < 0))
+ return (EX_PROTOCOL);
- if (flags & CVS_HF_O)
- cvs_sendarg(root, "-o", 0);
+ if ((flags & CVS_HF_O) && (cvs_sendarg(root, "-o", 0) < 0))
+ return (EX_PROTOCOL);
if (tag != NULL) {
- cvs_sendarg(root, "-t", 0);
- cvs_sendarg(root, tag, 0);
+ if ((cvs_sendarg(root, "-t", 0) < 0) ||
+ (cvs_sendarg(root, tag, 0) < 0))
+ return (EX_PROTOCOL);
}
if (user != NULL) {
- cvs_sendarg(root, "-u", 0);
- cvs_sendarg(root, user, 0);
+ if ((cvs_sendarg(root, "-u", 0) < 0) ||
+ (cvs_sendarg(root, user, 0) < 0))
+ return (EX_PROTOCOL);
}
- cvs_sendarg(root, "-z", 0);
- cvs_sendarg(root, zone, 0);
+ if ((cvs_sendarg(root, "-z", 0) < 0) ||
+ (cvs_sendarg(root, zone, 0) < 0))
+ return (EX_PROTOCOL);
- cvs_sendreq(root, CVS_REQ_HISTORY, NULL);
+ if (cvs_sendreq(root, CVS_REQ_HISTORY, NULL) < 0)
+ return (EX_PROTOCOL);
}
return (0);