diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2018-10-09 08:12:02 -0400 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2018-10-09 08:12:46 -0400 |
commit | d3f0e52784712696c7174d3adf8ec6cf3ac31b19 (patch) | |
tree | 313ca9e6eb03e9f5971d3fde90ace73b613ca9e4 /sway/config | |
parent | 1c969e86f50065985ddf35b7fef62c14aa7688a5 (diff) |
bar-bindsym: address ianyfan's comments
Diffstat (limited to 'sway/config')
-rw-r--r-- | sway/config/bar.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sway/config/bar.c b/sway/config/bar.c index f84407c9..c6899f57 100644 --- a/sway/config/bar.c +++ b/sway/config/bar.c @@ -32,9 +32,7 @@ void free_bar_binding(struct bar_binding *binding) { if (!binding) { return; } - if (binding->command) { - free(binding->command); - } + free(binding->command); free(binding); } @@ -49,9 +47,8 @@ void free_bar_config(struct bar_config *bar) { free(bar->status_command); free(bar->font); free(bar->separator_symbol); - while (bar->bindings->length) { - struct bar_binding *binding = bar->bindings->items[0]; - list_del(bar->bindings, 0); + for (int i = 0; i < bar->bindings->length; i++) { + struct bar_binding *binding = bar->bindings->items[i]; free_bar_binding(binding); } list_free(bar->bindings); |