aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/elfctl
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2022-02-15 03:30:29 +0000
committerEd Maste <emaste@FreeBSD.org>2022-02-15 03:35:03 +0000
commitb8185579f457569640f714b6180522619c2f18ea (patch)
tree0cbec40bb7d775bc529d8ad80d21b96f24429b49 /usr.bin/elfctl
parentf0cf9b602dc0375dfc279500e0314b7c55273bf0 (diff)
Diffstat (limited to 'usr.bin/elfctl')
-rw-r--r--usr.bin/elfctl/elfctl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/elfctl/elfctl.c b/usr.bin/elfctl/elfctl.c
index 8b3d20d4a9c7..993349d4ec4c 100644
--- a/usr.bin/elfctl/elfctl.c
+++ b/usr.bin/elfctl/elfctl.c
@@ -232,6 +232,10 @@ convert_to_feature_val(char *feature_str, uint32_t *feature_val)
input = 0;
operation = *feature_str;
feature_str++;
+
+ if (operation != '+' && operation != '-' && operation != '=')
+ errx(1, "'%c' not an operator - use '+', '-', '='", operation);
+
len = nitems(featurelist);
while ((feature = strsep(&feature_str, ",")) != NULL) {
for (i = 0; i < len; ++i) {
@@ -280,10 +284,6 @@ convert_to_feature_val(char *feature_str, uint32_t *feature_val)
*feature_val = input;
} else if (operation == '-') {
*feature_val &= ~input;
- } else {
- warnx("'%c' not an operator - use '+', '-', '='",
- feature_str[0]);
- return (false);
}
return (true);
}