summaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2016-12-02 18:08:15 -0500
committerDrew DeVault <[email protected]>2016-12-02 18:09:19 -0500
commitd353da248b4653d7bc027ff0dceca946cdd0b22f (patch)
treeb76f5d9b8164a9eb102eee6b6cb13c5b9f6cbc75 /sway/commands.c
parent62dad7148f7b7b314f0297e191861ae3f03e9e1f (diff)
Add ipc connection feature policy controls
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 47f7533c..3d8f8c5b 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -542,16 +542,15 @@ struct cmd_results *config_commands_command(char *exec) {
{ "criteria", CONTEXT_CRITERIA },
{ "all", CONTEXT_ALL },
};
- size_t names_len = 5;
for (int i = 1; i < argc; ++i) {
size_t j;
- for (j = 0; j < names_len; ++j) {
+ for (j = 0; j < sizeof(context_names) / sizeof(context_names[0]); ++j) {
if (strcmp(context_names[j].name, argv[i]) == 0) {
break;
}
}
- if (j == names_len) {
+ if (j == sizeof(context_names) / sizeof(context_names[0])) {
results = cmd_results_new(CMD_INVALID, cmd,
"Invalid command context %s", argv[i]);
goto cleanup;