aboutsummaryrefslogtreecommitdiff
path: root/tests/printstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/printstr.c')
-rw-r--r--tests/printstr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/printstr.c b/tests/printstr.c
index 330234f1..8e226813 100644
--- a/tests/printstr.c
+++ b/tests/printstr.c
@@ -34,13 +34,11 @@
#include <unistd.h>
#include <sys/uio.h>
-#define DEFAULT_STRLEN 32
-
int
main(void)
{
char *const buf = tail_alloc(DEFAULT_STRLEN + 1);
- const struct iovec io = {
+ struct iovec io = {
.iov_base = buf,
.iov_len = -1
};
@@ -64,6 +62,11 @@ main(void)
tprintf("writev(-1, [{iov_base=\"\\0%*s\"..., iov_len=%lu}], 1)"
" = %s\n", DEFAULT_STRLEN - 1, buf + 1, -1UL, sprintrc(rc));
+ ++io.iov_base;
+ rc = writev(-1, &io, 1);
+ tprintf("writev(-1, [{iov_base=%p, iov_len=%lu}], 1) = %s\n",
+ io.iov_base, -1UL, sprintrc(rc));
+
tprintf("+++ exited with 0 +++\n");
return 0;
}