aboutsummaryrefslogtreecommitdiffstats
path: root/sway/ipc-server.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-03-29 22:23:41 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-03-29 22:23:41 -0400
commitdbda7bfbed7d4ac67f7c2932dd0b82fb5531f89a (patch)
tree852d183db161888514cdff174dd5282e67af60e6 /sway/ipc-server.c
parentExit ipc_get_workspace_callback early (diff)
downloadsway-dbda7bfbed7d4ac67f7c2932dd0b82fb5531f89a.tar.gz
sway-dbda7bfbed7d4ac67f7c2932dd0b82fb5531f89a.tar.zst
sway-dbda7bfbed7d4ac67f7c2932dd0b82fb5531f89a.zip
Move declaration into loop
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r--sway/ipc-server.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c
index 872c5704..9d23607b 100644
--- a/sway/ipc-server.c
+++ b/sway/ipc-server.c
@@ -538,8 +538,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
538 if (!buf[0]) { 538 if (!buf[0]) {
539 // Send list of configured bar IDs 539 // Send list of configured bar IDs
540 json_object *bars = json_object_new_array(); 540 json_object *bars = json_object_new_array();
541 int i; 541 for (int i = 0; i < config->bars->length; ++i) {
542 for (i = 0; i < config->bars->length; ++i) {
543 struct bar_config *bar = config->bars->items[i]; 542 struct bar_config *bar = config->bars->items[i];
544 json_object_array_add(bars, json_object_new_string(bar->id)); 543 json_object_array_add(bars, json_object_new_string(bar->id));
545 } 544 }
@@ -549,8 +548,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
549 } else { 548 } else {
550 // Send particular bar's details 549 // Send particular bar's details
551 struct bar_config *bar = NULL; 550 struct bar_config *bar = NULL;
552 int i; 551 for (int i = 0; i < config->bars->length; ++i) {
553 for (i = 0; i < config->bars->length; ++i) {
554 bar = config->bars->items[i]; 552 bar = config->bars->items[i];
555 if (strcmp(buf, bar->id) == 0) { 553 if (strcmp(buf, bar->id) == 0) {
556 break; 554 break;