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:
Jiang Junyu
2020-02-21 13:53:38 -08:00
committed by Alexander Amelkin
parent 9d5ea21df7
commit 6e037d6bfb
34 changed files with 563 additions and 570 deletions

View File

@ -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;
}