diff options
-rw-r--r-- | sway/commands/assign.c | 2 | ||||
-rw-r--r-- | sway/commands/for_window.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sway/commands/assign.c b/sway/commands/assign.c index bf0b1f63..eb7329aa 100644 --- a/sway/commands/assign.c +++ b/sway/commands/assign.c | |||
@@ -22,7 +22,7 @@ struct cmd_results *cmd_assign(int argc, char **argv) { | |||
22 | } | 22 | } |
23 | 23 | ||
24 | char *movecmd = "move container to workspace "; | 24 | char *movecmd = "move container to workspace "; |
25 | int arglen = strlen(movecmd) + strlen(*argv) + 1; | 25 | size_t arglen = strlen(movecmd) + strlen(*argv) + 1; |
26 | char *cmdlist = calloc(1, arglen); | 26 | char *cmdlist = calloc(1, arglen); |
27 | if (!cmdlist) { | 27 | if (!cmdlist) { |
28 | return cmd_results_new(CMD_FAILURE, "assign", "Unable to allocate command list"); | 28 | return cmd_results_new(CMD_FAILURE, "assign", "Unable to allocate command list"); |
diff --git a/sway/commands/for_window.c b/sway/commands/for_window.c index a6aa7187..dd5461f0 100644 --- a/sway/commands/for_window.c +++ b/sway/commands/for_window.c | |||
@@ -14,7 +14,7 @@ struct cmd_results *cmd_for_window(int argc, char **argv) { | |||
14 | // add command to a criteria/command pair that is run against views when they appear. | 14 | // add command to a criteria/command pair that is run against views when they appear. |
15 | char *criteria = argv[0], *cmdlist = join_args(argv + 1, argc - 1); | 15 | char *criteria = argv[0], *cmdlist = join_args(argv + 1, argc - 1); |
16 | 16 | ||
17 | struct criteria *crit = malloc(sizeof(struct criteria)); | 17 | struct criteria *crit = calloc(sizeof(struct criteria), 1); |
18 | if (!crit) { | 18 | if (!crit) { |
19 | return cmd_results_new(CMD_FAILURE, "for_window", "Unable to allocate criteria"); | 19 | return cmd_results_new(CMD_FAILURE, "for_window", "Unable to allocate criteria"); |
20 | } | 20 | } |