From: Mark Marshall Date: Fri, 18 Jan 2019 08:10:34 +0000 (+0100) Subject: capability: fix string comparison in cap_name_to_number X-Git-Tag: 1_30_1~8 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fa86b27e24afa54b8df18f48f55fbbef40b7c6a8;p=oweals%2Fbusybox.git 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 Signed-off-by: Denys Vlasenko --- diff --git a/libbb/capability.c b/libbb/capability.c index 6587dcbf7..d0ae78b91 100644 --- a/libbb/capability.c +++ b/libbb/capability.c @@ -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);