diff options
author | Nathan Scott <nathans@redhat.com> | 2023-04-04 16:47:11 +1000 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2023-04-06 00:19:54 +0200 |
commit | 14da84f877a0f3627ddaea836c9537b2292fa22d (patch) | |
tree | d8eff482c76709187482e41eb36628b5de935078 /CommandLine.c | |
parent | e7f447b6a3473a572d3e6c191128f1796477860d (diff) |
Refactor to use a program name pointer instead of PACKAGE macro
During SEGV handling under pcp-htop several incorrect strings were
observed - in particular reporting htop as the binary name instead
of pcp-htop. This is something we want to be crystal clear on when
we request user stack traces etc, so make sure this cannot be done
incorrectly.
Diffstat (limited to 'CommandLine.c')
-rw-r--r-- | CommandLine.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/CommandLine.c b/CommandLine.c index 83359206..2b2a68c2 100644 --- a/CommandLine.c +++ b/CommandLine.c @@ -89,7 +89,7 @@ typedef struct CommandLineSettings_ { bool readonly; } CommandLineSettings; -static CommandLineStatus parseArguments(const char* program, int argc, char** argv, CommandLineSettings* flags) { +static CommandLineStatus parseArguments(int argc, char** argv, CommandLineSettings* flags) { *flags = (CommandLineSettings) { .pidMatchList = NULL, @@ -298,7 +298,7 @@ static void setCommFilter(State* state, char** commFilter) { *commFilter = NULL; } -int CommandLine_run(const char* name, int argc, char** argv) { +int CommandLine_run(int argc, char** argv) { /* initialize locale */ const char* lc_ctype; @@ -310,7 +310,7 @@ int CommandLine_run(const char* name, int argc, char** argv) { CommandLineStatus status = STATUS_OK; CommandLineSettings flags = { 0 }; - if ((status = parseArguments(name, argc, argv, &flags)) != STATUS_OK) + if ((status = parseArguments(argc, argv, &flags)) != STATUS_OK) return status != STATUS_OK_EXIT ? 1 : 0; if (flags.readonly) |