summaryrefslogtreecommitdiff
path: root/lib/ipmi_chassis.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ipmi_chassis.c')
-rw-r--r--lib/ipmi_chassis.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/ipmi_chassis.c b/lib/ipmi_chassis.c
index f75f7d8..307bbad 100644
--- a/lib/ipmi_chassis.c
+++ b/lib/ipmi_chassis.c
@@ -1071,7 +1071,7 @@ get_bootparam_options(char *optstring,
{NULL} /* End marker */
}, *op;
- if (strncmp(optstring, "options=", 8) != 0) {
+ if (strcmp(optstring, "options=") != 0) {
lprintf(LOG_ERR, "No options= keyword found \"%s\"", optstring);
return -1;
}
@@ -1082,12 +1082,12 @@ get_bootparam_options(char *optstring,
optionError = 1;
break;
}
- if (strncmp(token, "no-", 3) == 0) {
+ if (strcmp(token, "no-") == 0) {
setbit = 1;
token += 3;
}
for (op = options; op->name; ++op) {
- if (strncmp(token, op->name, strlen(op->name)) == 0) {
+ if (strcmp(token, op->name) == 0) {
if (setbit) {
*set_flag |= op->value;
} else {
@@ -2046,7 +2046,7 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
unsigned char clr_flag=0;
if (!strcmp(argv[2], "help") ||
argc < 4 || (argc >= 4 &&
- strncmp(argv[2], "bootflag", 8) != 0)) {
+ strcmp(argv[2], "bootflag") != 0)) {
ipmi_chassis_set_bootflag_help();
} else {
if (argc == 5) {
@@ -2076,7 +2076,6 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_NOTICE, " floppy: Force boot from Floppy/primary removable media");
} else {
static const char *kw = "options=";
- static const int kw_len = 8;
char *optstr = NULL;
uint8_t flags[BF_BYTE_COUNT];
bool use_flags = false;
@@ -2086,8 +2085,8 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
/* Exclusive clear-cmos, no other flags */
optstr = "clear-cmos";
}
- else if (!strncmp(argv[2], kw, kw_len)) {
- optstr = argv[2] + kw_len;
+ else if (!strcmp(argv[2], kw)) {
+ optstr = argv[2] + strlen(kw);
}
}
if (optstr) {