mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-07-03 11:13:35 +00:00
Refactor string comparisons
Clean up use of strcmp/strncmp/strncasecmp for command line arguments. Never use anything but `strcmp()` unless absolutely neccessary. Partialy resolves ipmitool/ipmitool#104
This commit is contained in:
committed by
Alexander Amelkin
parent
9d5ea21df7
commit
6e037d6bfb
@ -647,7 +647,7 @@ uint32_t str2val32(const char *str, const struct valstr *vs)
|
||||
int i;
|
||||
|
||||
for (i = 0; vs[i].str; i++) {
|
||||
if (strncasecmp(vs[i].str, str, __maxlen(str, vs[i].str)) == 0)
|
||||
if (strcasecmp(vs[i].str, str) == 0)
|
||||
return vs[i].val;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user