Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Marshall <mark.marshall@omicronenergy.com>2019-01-18 11:10:34 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2019-02-14 16:40:57 +0300
commitfa86b27e24afa54b8df18f48f55fbbef40b7c6a8 (patch)
treef2da67e02378ae84f88d88886c566fb138ff4f10
parentb5709543631aaa9a198dbb726b1d302a1696410e (diff)
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);