summaryrefslogtreecommitdiff
path: root/sway/commands/bar/id.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2018-03-29 22:05:16 -0400
committerDrew DeVault <[email protected]>2018-03-29 22:11:08 -0400
commit741424c4e7811c12d8cca28466f89bd61eaf3a75 (patch)
tree37af2aa063d42bf6ef3bc967bb1a5b6b679abbaf /sway/commands/bar/id.c
parent849c3515abff7033dbd4723fd7328cb07af74222 (diff)
Clean up imported bar commands
Diffstat (limited to 'sway/commands/bar/id.c')
-rw-r--r--sway/commands/bar/id.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sway/commands/bar/id.c b/sway/commands/bar/id.c
index d9e7f8df..c1e56f03 100644
--- a/sway/commands/bar/id.c
+++ b/sway/commands/bar/id.c
@@ -11,10 +11,8 @@ struct cmd_results *bar_cmd_id(int argc, char **argv) {
const char *name = argv[0];
const char *oldname = config->current_bar->id;
-
// check if id is used by a previously defined bar
- int i;
- for (i = 0; i < config->bars->length; ++i) {
+ for (int i = 0; i < config->bars->length; ++i) {
struct bar_config *find = config->bars->items[i];
if (strcmp(name, find->id) == 0 && config->current_bar != find) {
return cmd_results_new(CMD_FAILURE, "id",
@@ -27,7 +25,6 @@ struct cmd_results *bar_cmd_id(int argc, char **argv) {
// free old bar id
free(config->current_bar->id);
-
config->current_bar->id = strdup(name);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}