aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Mark Marshall <mark.marshall@omicronenergy.com>2019-01-18 09:10:34 +0100
committerGravatar Denys Vlasenko <vda.linux@googlemail.com>2019-02-14 14:40:57 +0100
commitfa86b27e24afa54b8df18f48f55fbbef40b7c6a8 (patch)
treef2da67e02378ae84f88d88886c566fb138ff4f10
parentb5709543631aaa9a198dbb726b1d302a1696410e (diff)
downloadbusybox-fa86b27e24afa54b8df18f48f55fbbef40b7c6a8.tar.gz
busybox-fa86b27e24afa54b8df18f48f55fbbef40b7c6a8.tar.bz2
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>
-rw-r--r--libbb/capability.c2
1 files changed, 1 insertions, 1 deletions
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);