aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/bind.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/bind.c')
-rw-r--r--sway/commands/bind.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index c0b383db..268f2855 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -1,4 +1,3 @@
1#define _POSIX_C_SOURCE 200809L
2#include <libevdev/libevdev.h> 1#include <libevdev/libevdev.h>
3#include <linux/input-event-codes.h> 2#include <linux/input-event-codes.h>
4#include <string.h> 3#include <string.h>
@@ -127,7 +126,7 @@ static struct cmd_results *identify_key(const char* name, bool first_key,
127 if (!button) { 126 if (!button) {
128 if (message) { 127 if (message) {
129 struct cmd_results *error = 128 struct cmd_results *error =
130 cmd_results_new(CMD_INVALID, message); 129 cmd_results_new(CMD_INVALID, "%s", message);
131 free(message); 130 free(message);
132 return error; 131 return error;
133 } else { 132 } else {
@@ -143,7 +142,7 @@ static struct cmd_results *identify_key(const char* name, bool first_key,
143 if (!button) { 142 if (!button) {
144 if (message) { 143 if (message) {
145 struct cmd_results *error = 144 struct cmd_results *error =
146 cmd_results_new(CMD_INVALID, message); 145 cmd_results_new(CMD_INVALID, "%s", message);
147 free(message); 146 free(message);
148 return error; 147 return error;
149 } else { 148 } else {
@@ -182,7 +181,7 @@ static struct cmd_results *identify_key(const char* name, bool first_key,
182 uint32_t button = get_mouse_bindsym(name, &message); 181 uint32_t button = get_mouse_bindsym(name, &message);
183 if (message) { 182 if (message) {
184 struct cmd_results *error = 183 struct cmd_results *error =
185 cmd_results_new(CMD_INVALID, message); 184 cmd_results_new(CMD_INVALID, "%s", message);
186 free(message); 185 free(message);
187 return error; 186 return error;
188 } else if (button) { 187 } else if (button) {
@@ -539,7 +538,7 @@ struct cmd_results *cmd_bind_or_unbind_switch(int argc, char **argv,
539 free_switch_binding(binding); 538 free_switch_binding(binding);
540 return cmd_results_new(CMD_FAILURE, 539 return cmd_results_new(CMD_FAILURE,
541 "Invalid %s command (expected binding with the form " 540 "Invalid %s command (expected binding with the form "
542 "<switch>:<state>)", bindtype, argc); 541 "<switch>:<state>)", bindtype);
543 } 542 }
544 if (strcmp(split->items[0], "tablet") == 0) { 543 if (strcmp(split->items[0], "tablet") == 0) {
545 binding->type = WLR_SWITCH_TYPE_TABLET_MODE; 544 binding->type = WLR_SWITCH_TYPE_TABLET_MODE;
@@ -549,7 +548,8 @@ struct cmd_results *cmd_bind_or_unbind_switch(int argc, char **argv,
549 free_switch_binding(binding); 548 free_switch_binding(binding);
550 return cmd_results_new(CMD_FAILURE, 549 return cmd_results_new(CMD_FAILURE,
551 "Invalid %s command (expected switch binding: " 550 "Invalid %s command (expected switch binding: "
552 "unknown switch %s)", bindtype, split->items[0]); 551 "unknown switch %s)", bindtype,
552 (const char *)split->items[0]);
553 } 553 }
554 if (strcmp(split->items[1], "on") == 0) { 554 if (strcmp(split->items[1], "on") == 0) {
555 binding->trigger = SWAY_SWITCH_TRIGGER_ON; 555 binding->trigger = SWAY_SWITCH_TRIGGER_ON;
@@ -562,7 +562,7 @@ struct cmd_results *cmd_bind_or_unbind_switch(int argc, char **argv,
562 return cmd_results_new(CMD_FAILURE, 562 return cmd_results_new(CMD_FAILURE,
563 "Invalid %s command " 563 "Invalid %s command "
564 "(expected switch state: unknown state %s)", 564 "(expected switch state: unknown state %s)",
565 bindtype, split->items[1]); 565 bindtype, (const char *)split->items[1]);
566 } 566 }
567 list_free_items_and_destroy(split); 567 list_free_items_and_destroy(split);
568 568