ipmitool / test

0 stars 0 forks source link

'lib/ipmi_event.c' - return code for help/arguments #29

Open AlexanderAmelkin opened 11 years ago

AlexanderAmelkin commented 11 years ago

Reported by: Zdenek Styblik Original Ticket: ipmitool/bugs/206

\-  if \(argc == 0 || strncmp\(argv\[0\], "help", 4\) == 0\) \{
\-      ipmi\_event\_usage\(\);
\-      return 0;
\-  \}

+ if (argc == 0) { + lprintf(LOG_ERR, "Not enough parameters given."); + ipmi_event_usage(); + return (-1); + } else if (strncmp(argv[0], "help", 4) == 0) { + ipmi_event_usage(); + return 0; + }


This is also wrong:

if (strncmp(argv[0], "file", 4) == 0) { if (argc < 2) { ipmi_event_usage(); return 0; } return ipmi_event_fromfile(intf, argv[1]); }

AlexanderAmelkin commented 11 years ago

Original comment by: Zdenek Styblik