]> git.cworth.org Git - notmuch/commitdiff
CLI: make static message strings const
authorDavid Bremner <david@tethera.net>
Wed, 12 May 2021 23:40:23 +0000 (20:40 -0300)
committerDavid Bremner <david@tethera.net>
Fri, 14 May 2021 09:42:55 +0000 (06:42 -0300)
This is both a bit clearer and avoids the possibility of modification.

notmuch-insert.c
notmuch-new.c
notmuch-reindex.c
notmuch-tag.c

index 00c0046873f50cc788717ebb86ef6a10314bf70a..e3d87e4aed184af827b35e0e5276ff9b6cdc3f4d 100644 (file)
@@ -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
index 993359d603a9bf75d9e606014741ee9cc6f0d83f..1162e25a1273975c7a9c77473f5e6299e23fbc13 100644 (file)
@@ -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
index 8904c1f41dca4d880a23708616705b76ede399eb..a7380a4bc197beb60f8140b9c37c5cc06ed8cf3e 100644 (file)
@@ -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
index 667a75d6b960c3b2cc27b75d08753a813badc037..de428c8e9d99b902701a296a577cba87cb00c99c 100644 (file)
@@ -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