aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sway/commands/workspace.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sway/commands/workspace.c b/sway/commands/workspace.c
index b911b2f6..2858a284 100644
--- a/sway/commands/workspace.c
+++ b/sway/commands/workspace.c
@@ -60,6 +60,9 @@ static struct cmd_results *cmd_workspace_gaps(int argc, char **argv,
int gaps_location) {
const char expected[] = "Expected 'workspace <name> gaps "
"inner|outer|horizontal|vertical|top|right|bottom|left <px>'";
+ if (gaps_location == 0) {
+ return cmd_results_new(CMD_INVALID, expected);
+ }
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "workspace", EXPECTED_EQUAL_TO,
gaps_location + 3))) {
@@ -140,7 +143,10 @@ struct cmd_results *cmd_workspace(int argc, char **argv) {
break;
}
}
- if (output_location >= 0) {
+ if (output_location == 0) {
+ return cmd_results_new(CMD_INVALID,
+ "Expected 'workspace <name> output <output>'");
+ } else if (output_location > 0) {
if ((error = checkarg(argc, "workspace", EXPECTED_AT_LEAST,
output_location + 2))) {
return error;