mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-15 07:54:33 +00:00
BUILD: cli: appease a null-deref warning in cli_gen_usage_msg()
The compiler sees the possibility of null-deref for which a path is possible but which doesn't exist as we didn't pass a null args outside of the help request. The test was introduced by the simplified test on ishelp variable, so let's add it to shut the warning.
This commit is contained in:
parent
7deb28ce65
commit
5db446d7e1
@ -143,7 +143,7 @@ static char *cli_gen_usage_msg(struct appctx *appctx, char * const *args)
|
||||
chunk_reset(tmp);
|
||||
if (ishelp) // this is the help message.
|
||||
chunk_strcat(tmp, "The following commands are valid at this level:\n");
|
||||
else if (!length && (!*args || !**args)) // no match
|
||||
else if (!length && (!args || !*args || !**args)) // no match
|
||||
chunk_strcat(tmp, "Unknown command. Please enter one of the following commands only:\n");
|
||||
else // partial match
|
||||
chunk_strcat(tmp, "Unknown command, but maybe one of the following ones is a better match:\n");
|
||||
|
Loading…
Reference in New Issue
Block a user