diff options
author | Mark Marshall | 2019-01-18 09:10:34 +0100 |
---|---|---|
committer | Denys Vlasenko | 2019-02-14 14:40:57 +0100 |
commit | fa86b27e24afa54b8df18f48f55fbbef40b7c6a8 (patch) | |
tree | f2da67e02378ae84f88d88886c566fb138ff4f10 /libbb | |
parent | b5709543631aaa9a198dbb726b1d302a1696410e (diff) | |
download | busybox-fa86b27e24afa54b8df18f48f55fbbef40b7c6a8.zip busybox-fa86b27e24afa54b8df18f48f55fbbef40b7c6a8.tar.gz |
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>
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/capability.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 @@ 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); |