From cdc958b8a2560c44d8f8f368c880969173785265 Mon Sep 17 00:00:00 2001 From: Matthew Vernon Date: Fri, 7 Nov 2025 11:43:15 +0000 Subject: [PATCH] Check return value of read(2) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Again, picked up by newer tooling. squish.c:648:25: error: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result] --- squish.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/squish.c b/squish.c index 91c866e..2c1607a 100644 --- a/squish.c +++ b/squish.c @@ -645,7 +645,9 @@ int main(int argc,char **argv) fprintf(stderr, " do you wish to overwrite %s (y or n)? ", ofname); fflush(stderr); - read(2, response, 2); + if (read(2, response, 2) < 1) { + perror("stderr"); break; + } while (response[1] != '\n') { if (read(2, response+1, 1) < 0) { /* Ack! */ perror("stderr"); break; -- 2.30.2