summaryrefslogtreecommitdiff
path: root/tools/command.c
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-09-20 10:24:30 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2021-09-20 14:26:09 +0200
commitebd150366f0852e7ebd32e7743e6a135138320a0 (patch)
tree30371d71ac127b6885e9d0149be4fa1559966fcd /tools/command.c
parent752a9ec4b44198554b9f998ed6e4a837878fc49f (diff)
downloadlvm2-ebd150366f0852e7ebd32e7743e6a135138320a0.tar.gz
cov: add explicit NULL pointer check
Make obvious to coverity strcmp() is not getting NULL pointer.
Diffstat (limited to 'tools/command.c')
-rw-r--r--tools/command.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/command.c b/tools/command.c
index 48f572f7e..18ffd64ed 100644
--- a/tools/command.c
+++ b/tools/command.c
@@ -4015,9 +4015,9 @@ int main(int argc, char *argv[])
factor_common_options();
- if (primary)
+ if (primary && cmdname)
r = _print_man(cmdname, desfile, secondary);
- else if (secondary) {
+ else if (secondary && cmdname) {
r = 1;
_print_man_secondary(cmdname);
} else if (check) {