From 4bc1cc49d5b8007145774214bc9126577b56b53c Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 18 Mar 2018 17:17:28 -0400 Subject: [PATCH] Fix strcmp use --- examples/layer-shell.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/layer-shell.c b/examples/layer-shell.c index 285bec5aa..9b26386d8 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;