summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2013-03-15 10:58:56 -0700
committerRuss Allbery <rra@stanford.edu>2013-03-15 11:57:09 -0700
commitfd53716404f347149ddc46f00c2793558dd56fa0 (patch)
tree9b712395df02cd149959d74c17829728b4cbb089 /util
parent52acdd342fb24fd5b22b3fa1f5a2a2c5454882a6 (diff)
Update to rra-c-util 4.8 and C TAP Harness 2.0
Update to rra-c-util 4.8: * Improve Perl module tests. * Cleanly passes clang --analyze. Update to C TAP Harness 2.0: * runtests now treats the command line as a list of tests by default. * The full test executable path can now be passed to runtests -o. * Improved harness output for tests with lazy plans. * Improved harness output to a terminal for some abort cases. * Flush harness output after each test even when not on a terminal. Copy the Test::RRA::* libraries into the perl directory rather than retaining two copies. Add synopsis testing. Update the Perl manifest for the current state of the world. Fix various issues with the clean and distclean targets not handling the Perl directory properly. Change-Id: I75d733331d1d28f8a9976f7629239640cff17756 Reviewed-on: https://gerrit.stanford.edu/946 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
Diffstat (limited to 'util')
-rw-r--r--util/xwrite.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/xwrite.c b/util/xwrite.c
index 8d472a7..d1cb6cf 100644
--- a/util/xwrite.c
+++ b/util/xwrite.c
@@ -24,7 +24,7 @@
* The canonical version of this file is maintained in the rra-c-util package,
* which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
*
- * Copyright 2008
+ * Copyright 2008, 2013
* The Board of Trustees of the Leland Stanford Junior University
* Copyright (c) 2004, 2005, 2006
* by Internet Systems Consortium, Inc. ("ISC")
@@ -51,6 +51,7 @@
#include <portable/system.h>
#include <portable/uio.h>
+#include <assert.h>
#include <errno.h>
#include <util/xwrite.h>
@@ -175,6 +176,7 @@ xwritev(int fd, const struct iovec iov[], int iovcnt)
for (i = 0; offset >= (size_t) iov[i].iov_len; i++)
offset -= iov[i].iov_len;
iovleft = iovcnt - i;
+ assert(iovleft > 0);
tmpiov = malloc(iovleft * sizeof(struct iovec));
if (tmpiov == NULL)
return -1;