From d1266625608f8f593f4df76c1b6ff1897c89adc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 5 Sep 2021 12:39:25 +0200 Subject: [PATCH] term: reduce scope of variable --- terminal.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/terminal.c b/terminal.c index a95a5c61..0138aa15 100644 --- a/terminal.c +++ b/terminal.c @@ -230,13 +230,11 @@ fdm_ptmx(struct fdm *fdm, int fd, int events, void *data) } uint8_t buf[24 * 1024]; - ssize_t count = sizeof(buf); - const size_t max_iterations = !hup ? 10 : (size_t)-1ll; for (size_t i = 0; i < max_iterations && pollin; i++) { xassert(pollin); - count = read(term->ptmx, buf, sizeof(buf)); + ssize_t count = read(term->ptmx, buf, sizeof(buf)); if (count < 0) { if (errno == EAGAIN || errno == EIO) {