aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-03-18 17:17:28 -0400
committerDrew DeVault <sir@cmpwn.com>2018-03-27 18:50:09 -0400
commit4bc1cc49d5b8007145774214bc9126577b56b53c (patch)
treea483b7afcb6161bdebabcdc2903528aa4b8bcfdb
parentb31ce4220cea6acede2ae2af1b19a3a7d4b81fc6 (diff)
Fix strcmp use
-rw-r--r--examples/layer-shell.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/layer-shell.c b/examples/layer-shell.c
index 285bec5a..9b26386d 100644
--- a/examples/layer-shell.c
+++ b/examples/layer-shell.c
@@ -121,7 +121,7 @@ int main(int argc, char **argv) {
};
found = false;
for (size_t i = 0; i < sizeof(layers) / sizeof(layers[0]); ++i) {
- if (strcmp(optarg, layers[i].name)) {
+ if (strcmp(optarg, layers[i].name) == 0) {
layer = layers[i].value;
found = true;
break;
@@ -145,7 +145,7 @@ int main(int argc, char **argv) {
};
found = false;
for (size_t i = 0; i < sizeof(anchors) / sizeof(anchors[0]); ++i) {
- if (strcmp(optarg, anchors[i].name)) {
+ if (strcmp(optarg, anchors[i].name) == 0) {
anchor |= anchors[i].value;
found = true;
break;