capability: fix string comparison in cap_name_to_number
The result of strcasecmp was being used incorrectly. This function returns 0 if the strings match. Signed-off-by: Mark Marshall <mark.marshall@omicronenergy.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
fc472ea187
commit
11cb9eeffe
@ -67,7 +67,7 @@ unsigned FAST_FUNC cap_name_to_number(const char *cap)
|
||||
goto found;
|
||||
}
|
||||
for (i = 0; i < ARRAY_SIZE(capabilities); i++) {
|
||||
if (strcasecmp(capabilities[i], cap) != 0)
|
||||
if (strcasecmp(capabilities[i], cap) == 0)
|
||||
goto found;
|
||||
}
|
||||
bb_error_msg_and_die("unknown capability '%s'", cap);
|
||||
|
Loading…
Reference in New Issue
Block a user