CLI: make static message strings const

This is both a bit clearer and avoids the possibility of modification.
This commit is contained in:
David Bremner 2021-05-12 20:40:23 -03:00
parent 19983fe554
commit 0c6569d97c
4 changed files with 4 additions and 4 deletions

View file

@ -34,7 +34,7 @@ static volatile sig_atomic_t interrupted;
static void static void
handle_sigint (unused (int sig)) 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 /* This write is "opportunistic", so it's okay to ignore the
* result. It is not required for correctness, and if it does * result. It is not required for correctness, and if it does

View file

@ -81,7 +81,7 @@ static volatile sig_atomic_t interrupted;
static void static void
handle_sigint (unused (int sig)) 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 /* This write is "opportunistic", so it's okay to ignore the
* result. It is not required for correctness, and if it does * result. It is not required for correctness, and if it does

View file

@ -26,7 +26,7 @@ static volatile sig_atomic_t interrupted;
static void static void
handle_sigint (unused (int sig)) 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 /* This write is "opportunistic", so it's okay to ignore the
* result. It is not required for correctness, and if it does * result. It is not required for correctness, and if it does

View file

@ -27,7 +27,7 @@ static volatile sig_atomic_t interrupted;
static void static void
handle_sigint (unused (int sig)) 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 /* This write is "opportunistic", so it's okay to ignore the
* result. It is not required for correctness, and if it does * result. It is not required for correctness, and if it does