[PATCH 6/7] CLI: make static message strings const

Subject: [PATCH 6/7] CLI: make static message strings const

Date: Thu, 13 May 2021 07:07:09 -0300

To: notmuch@notmuchmail.org

Cc: David Bremner

From: David Bremner


This is both a bit clearer and avoids the possibility of modification.
---
 notmuch-insert.c | 2 +-
 notmuch-tag.c    | 2 +-
 2 files changed, 2 insertions(+), 2 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-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.30.2
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: