From 0c6569d97cda26cf6ce71da86d845d4276967016 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 12 May 2021 20:40:23 -0300 Subject: [PATCH] CLI: make static message strings const This is both a bit clearer and avoids the possibility of modification. --- notmuch-insert.c | 2 +- notmuch-new.c | 2 +- notmuch-reindex.c | 2 +- notmuch-tag.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/notmuch-insert.c b/notmuch-insert.c index 00c00468..e3d87e4a 100644 --- a/notmuch-insert.c +++ b/notmuch-insert.c @@ -34,7 +34,7 @@ static volatile sig_atomic_t interrupted; static void handle_sigint (unused (int sig)) { - static char msg[] = "Stopping... \n"; + static const char msg[] = "Stopping... \n"; /* This write is "opportunistic", so it's okay to ignore the * result. It is not required for correctness, and if it does diff --git a/notmuch-new.c b/notmuch-new.c index 993359d6..1162e25a 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -81,7 +81,7 @@ static volatile sig_atomic_t interrupted; static void handle_sigint (unused (int sig)) { - static char msg[] = "Stopping... \n"; + static const char msg[] = "Stopping... \n"; /* This write is "opportunistic", so it's okay to ignore the * result. It is not required for correctness, and if it does diff --git a/notmuch-reindex.c b/notmuch-reindex.c index 8904c1f4..a7380a4b 100644 --- a/notmuch-reindex.c +++ b/notmuch-reindex.c @@ -26,7 +26,7 @@ static volatile sig_atomic_t interrupted; static void handle_sigint (unused (int sig)) { - static char msg[] = "Stopping... \n"; + static const char msg[] = "Stopping... \n"; /* This write is "opportunistic", so it's okay to ignore the * result. It is not required for correctness, and if it does diff --git a/notmuch-tag.c b/notmuch-tag.c index 667a75d6..de428c8e 100644 --- a/notmuch-tag.c +++ b/notmuch-tag.c @@ -27,7 +27,7 @@ static volatile sig_atomic_t interrupted; static void handle_sigint (unused (int sig)) { - static char msg[] = "Stopping... \n"; + static const char msg[] = "Stopping... \n"; /* This write is "opportunistic", so it's okay to ignore the * result. It is not required for correctness, and if it does -- 2.43.0