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:
Mark Marshall authored and Denys Vlasenko committed 2019-01-21 12:50:37 +01:00
1 parent fc472ea187
commit 11cb9eeffe
1 file changed
+1 -1
+1 -1
View File
@@ -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);