aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/for_window.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-04-24 20:07:09 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-04-24 20:08:32 +1000
commit689a6a5605fb52f40b2c13f7565e19334fd09842 (patch)
tree10710cc575f77e3131e90c93483832468ab27a03 /sway/commands/for_window.c
parentAdd assert to view_execute_criteria() (diff)
downloadsway-689a6a5605fb52f40b2c13f7565e19334fd09842.tar.gz
sway-689a6a5605fb52f40b2c13f7565e19334fd09842.tar.zst
sway-689a6a5605fb52f40b2c13f7565e19334fd09842.zip
Use size_t instead of int and calloc instead of malloc
Diffstat (limited to 'sway/commands/for_window.c')
-rw-r--r--sway/commands/for_window.c2
1 files changed, 1 insertions, 1 deletions
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 }