summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Marshall2019-01-18 09:10:34 +0100
committerDenys Vlasenko2019-01-21 12:50:37 +0100
commit11cb9eeffec0e2575c8722e83de3116f81b61b4f (patch)
tree7e58fd78e22a6c5a02f16299572ec61f880739ce
parentfc472ea18793d8000c6f4ec1cd06c28c05340879 (diff)
downloadbusybox-11cb9eeffec0e2575c8722e83de3116f81b61b4f.zip
busybox-11cb9eeffec0e2575c8722e83de3116f81b61b4f.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>
-rw-r--r--libbb/capability.c2
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);