From ce95875445c67808caa5d4fb0e6f80dbdaef0cb7 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 14 May 2024 21:22:57 +0200 Subject: Adding upstream version 2.40.1. Signed-off-by: Daniel Baumann --- term-utils/ttymsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'term-utils/ttymsg.c') diff --git a/term-utils/ttymsg.c b/term-utils/ttymsg.c index faa0344..ef7e358 100644 --- a/term-utils/ttymsg.c +++ b/term-utils/ttymsg.c @@ -123,7 +123,7 @@ ttymsg(struct iovec *iov, size_t iovcnt, char *line, int tmout) { iovcnt * sizeof(struct iovec)); iov = localiov; } - for (cnt = 0; wret >= (ssize_t) iov->iov_len; ++cnt) { + for (cnt = 0; wret >= (ssize_t) iov->iov_len && iovcnt > 0; ++cnt) { wret -= iov->iov_len; ++iov; --iovcnt; -- cgit v1.2.3