1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-28 02:50:41 +03:00

cmdline: ensure command struct is defined

Make it clear to Coverity cmd will be defined.
This commit is contained in:
Zdenek Kabelac 2017-04-01 12:17:16 +02:00
parent 635e7e0c92
commit 3503ef23e3

View File

@ -1832,7 +1832,7 @@ static void _short_usage(const char *name)
static int _usage(const char *name, int longhelp, int skip_notes)
{
struct command_name *cname = find_command_name(name);
struct command *cmd;
struct command *cmd = NULL;
int show_full = longhelp;
int i;
@ -1876,6 +1876,11 @@ static int _usage(const char *name, int longhelp, int skip_notes)
}
/* Common options are printed once for all variants of a command name. */
if (!cmd) {
log_error(INTERNAL_ERROR "Command %s not found.", name);
return 0;
}
print_usage_common_cmd(cname, cmd);
print_usage_common_lvm(cname, cmd);