diff --git a/io.c b/io.c
index ce787cd..a52904c 100644
--- a/io.c
+++ b/io.c
@@ -57,65 +57,57 @@
 	return RVAL_DECODED;
 }
 
+struct print_iovec_config {
+	int decode_iov;
+	unsigned long data_size;
+};
+
+static bool
+print_iovec(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+	const unsigned long *iov;
+	unsigned long iov_buf[2];
+	struct print_iovec_config *c = data;
+
+        if (elem_size < sizeof(iov_buf)) {
+		iov_buf[0] = ((unsigned int *) elem_buf)[0];
+		iov_buf[1] = ((unsigned int *) elem_buf)[1];
+		iov = iov_buf;
+	} else {
+		iov = elem_buf;
+	}
+
+	tprints("{");
+
+	if (c->decode_iov) {
+		unsigned long len = iov[1];
+		if (len > c->data_size)
+			len = c->data_size;
+		c->data_size -= len;
+		printstr(tcp, iov[0], len);
+	} else {
+		printaddr(iov[0]);
+	}
+
+	tprintf(", %lu}", iov[1]);
+
+	return true;
+}
+
 /*
  * data_size limits the cumulative size of printed data.
  * Example: recvmsg returing a short read.
  */
 void
-tprint_iov_upto(struct tcb *tcp, unsigned long len, unsigned long addr, int decode_iov, unsigned long data_size)
+tprint_iov_upto(struct tcb *tcp, unsigned long len, unsigned long addr,
+		int decode_iov, unsigned long data_size)
 {
 	unsigned long iov[2];
-	unsigned long size, cur, end, abbrev_end;
-	const unsigned long sizeof_iov = current_wordsize * 2;
+	struct print_iovec_config config =
+		{ .decode_iov = decode_iov, .data_size = data_size };
 
-	if (!len) {
-		tprints("[]");
-		return;
-	}
-	size = len * sizeof_iov;
-	end = addr + size;
-	if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) ||
-	    !addr || size / sizeof_iov != len || end < addr) {
-		printaddr(addr);
-		return;
-	}
-	if (abbrev(tcp)) {
-		abbrev_end = addr + max_strlen * sizeof_iov;
-		if (abbrev_end < addr)
-			abbrev_end = end;
-	} else {
-		abbrev_end = end;
-	}
-	if (addr >= abbrev_end) {
-		tprints("[...]");
-		return;
-	}
-	for (cur = addr; cur < end; cur += sizeof_iov) {
-		if (cur > addr) {
-			tprints(", ");
-			if (cur >= abbrev_end) {
-				tprints("...");
-				break;
-			}
-		}
-		if (umove_ulong_array_or_printaddr(tcp, cur, iov,
-						   ARRAY_SIZE(iov)))
-			break;
-		if (cur <= addr)
-			tprints("[");
-		tprints("{");
-		if (decode_iov) {
-			unsigned long len = iov[1];
-			if (len > data_size)
-				len = data_size;
-			data_size -= len;
-			printstr(tcp, iov[0], len);
-		} else
-			printaddr(iov[0]);
-		tprintf(", %lu}", iov[1]);
-	}
-	if (cur > addr)
-		tprints("]");
+	print_array(tcp, addr, len, iov, current_wordsize * 2,
+		    umoven_or_printaddr, print_iovec, &config);
 }
 
 void
