aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/output
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/output')
-rw-r--r--sway/commands/output/background.c11
-rw-r--r--sway/commands/output/mode.c2
-rw-r--r--sway/commands/output/position.c2
3 files changed, 8 insertions, 7 deletions
diff --git a/sway/commands/output/background.c b/sway/commands/output/background.c
index 55cbdff0..4ed56c2a 100644
--- a/sway/commands/output/background.c
+++ b/sway/commands/output/background.c
@@ -72,7 +72,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
72 src = strdup(p.we_wordv[0]); 72 src = strdup(p.we_wordv[0]);
73 wordfree(&p); 73 wordfree(&p);
74 if (!src) { 74 if (!src) {
75 wlr_log(L_ERROR, "Failed to duplicate string"); 75 wlr_log(WLR_ERROR, "Failed to duplicate string");
76 return cmd_results_new(CMD_FAILURE, "output", 76 return cmd_results_new(CMD_FAILURE, "output",
77 "Unable to allocate resource"); 77 "Unable to allocate resource");
78 } 78 }
@@ -80,9 +80,10 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
80 if (config->reading && *src != '/') { 80 if (config->reading && *src != '/') {
81 // src file is inside configuration dir 81 // src file is inside configuration dir
82 82
83 char *conf = strdup(config->current_config); 83 char *conf = strdup(config->current_config_path);
84 if(!conf) { 84 if (!conf) {
85 wlr_log(L_ERROR, "Failed to duplicate string"); 85 wlr_log(WLR_ERROR, "Failed to duplicate string");
86 free(src);
86 return cmd_results_new(CMD_FAILURE, "output", 87 return cmd_results_new(CMD_FAILURE, "output",
87 "Unable to allocate resources"); 88 "Unable to allocate resources");
88 } 89 }
@@ -93,7 +94,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
93 if (!src) { 94 if (!src) {
94 free(rel_path); 95 free(rel_path);
95 free(conf); 96 free(conf);
96 wlr_log(L_ERROR, "Unable to allocate memory"); 97 wlr_log(WLR_ERROR, "Unable to allocate memory");
97 return cmd_results_new(CMD_FAILURE, "output", 98 return cmd_results_new(CMD_FAILURE, "output",
98 "Unable to allocate resources"); 99 "Unable to allocate resources");
99 } 100 }
diff --git a/sway/commands/output/mode.c b/sway/commands/output/mode.c
index daec6d44..ef56ae9e 100644
--- a/sway/commands/output/mode.c
+++ b/sway/commands/output/mode.c
@@ -36,11 +36,11 @@ struct cmd_results *output_cmd_mode(int argc, char **argv) {
36 } 36 }
37 } else { 37 } else {
38 // Format is 1234 4321 38 // Format is 1234 4321
39 argc--; argv++;
39 if (!argc) { 40 if (!argc) {
40 return cmd_results_new(CMD_INVALID, "output", 41 return cmd_results_new(CMD_INVALID, "output",
41 "Missing mode argument (height)."); 42 "Missing mode argument (height).");
42 } 43 }
43 argc--; argv++;
44 output->height = strtol(*argv, &end, 10); 44 output->height = strtol(*argv, &end, 10);
45 if (*end) { 45 if (*end) {
46 return cmd_results_new(CMD_INVALID, "output", 46 return cmd_results_new(CMD_INVALID, "output",
diff --git a/sway/commands/output/position.c b/sway/commands/output/position.c
index c2aeb281..449767b1 100644
--- a/sway/commands/output/position.c
+++ b/sway/commands/output/position.c
@@ -27,11 +27,11 @@ struct cmd_results *output_cmd_position(int argc, char **argv) {
27 } 27 }
28 } else { 28 } else {
29 // Format is 1234 4321 (legacy) 29 // Format is 1234 4321 (legacy)
30 argc--; argv++;
30 if (!argc) { 31 if (!argc) {
31 return cmd_results_new(CMD_INVALID, "output", 32 return cmd_results_new(CMD_INVALID, "output",
32 "Missing position argument (y)."); 33 "Missing position argument (y).");
33 } 34 }
34 argc--; argv++;
35 config->handler_context.output_config->y = strtol(*argv, &end, 10); 35 config->handler_context.output_config->y = strtol(*argv, &end, 10);
36 if (*end) { 36 if (*end) {
37 return cmd_results_new(CMD_INVALID, "output", 37 return cmd_results_new(CMD_INVALID, "output",