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/commands/bar/bindsym.c | |
parent | 1c969e86f50065985ddf35b7fef62c14aa7688a5 (diff) |
bar-bindsym: address ianyfan's comments
Diffstat (limited to 'sway/commands/bar/bindsym.c')
-rw-r--r-- | sway/commands/bar/bindsym.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/commands/bar/bindsym.c b/sway/commands/bar/bindsym.c index b0df9eff..4eea3e6a 100644 --- a/sway/commands/bar/bindsym.c +++ b/sway/commands/bar/bindsym.c @@ -33,12 +33,12 @@ struct cmd_results *bar_cmd_bindsym(int argc, char **argv) { binding->button = 0; if (strncasecmp(argv[0], "button", strlen("button")) == 0 && strlen(argv[0]) == strlen("button0")) { - binding->button = argv[0][strlen("button")] - '1' + 1; + binding->button = argv[0][strlen("button")] - '0'; } - if (binding->button == 0) { + if (binding->button < 1 || binding->button > 9) { free_bar_binding(binding); return cmd_results_new(CMD_FAILURE, "bar bindsym", - "Only button<n> is supported"); + "Only button<1-9> is supported"); } binding->command = join_args(argv + 1, argc - 1); |