From 13fb209a600c987a814af51ef6b7c02c3719ac6f Mon Sep 17 00:00:00 2001 From: Harald Date: Thu, 10 Aug 2023 17:02:11 +0200 Subject: [PATCH] write used the wrong char count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes this error: main.c:824:7: error: ‘write’ reading 18 bytes from a region of size 17 [-Werror=stringop-overread] 824 | if (write (1, "SIGNAL received\n", 18) < 0) { the string is 16 chars long (including the \n but excluding the \0, that is included in that 17 of the error message) --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 4776f073..8d99a833 100644 --- a/main.c +++ b/main.c @@ -821,7 +821,7 @@ void termination_signal_handler (int signum) { rl_cleanup_after_signal (); } - if (write (1, "SIGNAL received\n", 18) < 0) { + if (write (1, "SIGNAL received\n", 16) < 0) { // Sad thing }