From d353da248b4653d7bc027ff0dceca946cdd0b22f Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 2 Dec 2016 18:08:15 -0500 Subject: Add ipc connection feature policy controls --- sway/commands.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sway/commands.c') 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; -- cgit v1.2.3