diff options
Diffstat (limited to 'lib/ipmi_gendev.c')
-rw-r--r-- | lib/ipmi_gendev.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/ipmi_gendev.c b/lib/ipmi_gendev.c index 2fd7d02..215a717 100644 --- a/lib/ipmi_gendev.c +++ b/lib/ipmi_gendev.c @@ -541,8 +541,7 @@ ipmi_gendev_main(struct ipmi_intf *intf, int argc, char **argv) lprintf(LOG_ERR, "Rx gendev command: %s", argv[0]); - if (!argc - || strcmp(argv[0], "help") == 0) + if (!argc || !strcmp(argv[0], "help")) { lprintf(LOG_ERR, "SDR Commands: list read write"); @@ -552,9 +551,9 @@ ipmi_gendev_main(struct ipmi_intf *intf, int argc, char **argv) " read <sdr name> <file> Read to file eeprom specify by Generic Device Locators"); lprintf(LOG_ERR, " write <sdr name> <file> Write from file eeprom specify by Generic Device Locators"); - } else if (strcmp(argv[0], "list") == 0) { + } else if (!strcmp(argv[0], "list")) { rc = ipmi_sdr_print_sdr(intf, SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR); - } else if (strcmp(argv[0], "read") == 0) { + } else if (!strcmp(argv[0], "read")) { if (argc < 3) lprintf(LOG_ERR, "usage: gendev read <gendev> <filename>"); else { @@ -580,7 +579,7 @@ ipmi_gendev_main(struct ipmi_intf *intf, int argc, char **argv) ipmi_gendev_read_file(intf, sdr->record.genloc, argv[2]); } - } else if (strcmp(argv[0], "write") == 0) { + } else if (!strcmp(argv[0], "write")) { if (argc < 3) lprintf(LOG_ERR, "usage: gendev write <gendev> <filename>"); else { |