Skip to content

Commit

Permalink
Standardize usage string var declarations
Browse files Browse the repository at this point in the history
Changes:

* Name them all "usage_str"
* Make them const

For the latter item, see commit eb20f52 ("Make list of paths const to
fix a false positive of gcc analyzer", 2022-07-27) / PR netblue30#5275.
  • Loading branch information
kmk3 committed May 14, 2023
1 parent 727da58 commit 874cf79
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/firecfg/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int arg_debug = 0;
char *arg_bindir = "/usr/local/bin";
int arg_guide = 0;

static char *usage_str =
static const char *const usage_str =
"Firecfg is the desktop configuration utility for Firejail software. The utility\n"
"creates several symbolic links to firejail executable. This allows the user to\n"
"sandbox applications automatically, just by clicking on a regular desktop\n"
Expand Down
2 changes: 1 addition & 1 deletion src/firejail/usage.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
#include "firejail.h"

static char *usage_str =
static const char *const usage_str =
"Firejail is a SUID sandbox program that reduces the risk of security breaches by\n"
"restricting the running environment of untrusted applications using Linux\n"
"namespaces.\n"
Expand Down
4 changes: 2 additions & 2 deletions src/firemon/usage.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
#include "firemon.h"

static char *help_str =
static const char *const usage_str =
"Usage: firemon [OPTIONS] [PID]\n\n"
"Monitor processes started in a Firejail sandbox. Without any PID specified,\n"
"all processes started by Firejail are monitored. Descendants of these processes\n"
Expand Down Expand Up @@ -84,5 +84,5 @@ void print_version(void) {

void usage(void) {
print_version();
puts(help_str);
puts(usage_str);
}
2 changes: 1 addition & 1 deletion src/jailcheck/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ char *user_home_dir = NULL;
char *user_run_dir = NULL;
int arg_debug = 0;

static char *usage_str =
static const char *const usage_str =
"Usage: jailcheck [options] directory [directory]\n\n"
"Options:\n"
" --debug - print debug messages.\n"
Expand Down

0 comments on commit 874cf79

Please sign in to comment.