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>
diff --git a/libbb/capability.c b/libbb/capability.c
index 6587dcb..d0ae78b 100644
--- a/libbb/capability.c
+++ b/libbb/capability.c
@@ -67,7 +67,7 @@
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);