aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/output/mode.c
diff options
context:
space:
mode:
authorLibravatar Dominique Martinet <asmadeus@codewreck.org>2018-06-30 22:16:54 +0900
committerLibravatar Dominique Martinet <asmadeus@codewreck.org>2018-07-02 08:03:41 +0900
commitab187405297b77f85e0d5ed9630ae43b2db61324 (patch)
treeaa8de78559f56439eff75d8b605eaa0d347a9f32 /sway/commands/output/mode.c
parentconfig_commands_command: make alloc failure check more permanent (diff)
downloadsway-ab187405297b77f85e0d5ed9630ae43b2db61324.tar.gz
sway-ab187405297b77f85e0d5ed9630ae43b2db61324.tar.zst
sway-ab187405297b77f85e0d5ed9630ae43b2db61324.zip
output commands: move !argc checks after argc gets decremented
Found through static analysis.
Diffstat (limited to 'sway/commands/output/mode.c')
-rw-r--r--sway/commands/output/mode.c2
1 files changed, 1 insertions, 1 deletions
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",