From b865dabebab717fea75f91e8ccebabc99e36bdd9 Mon Sep 17 00:00:00 2001 From: Connor E <38229097+c-edw@users.noreply.github.com> Date: Sat, 10 Nov 2018 12:55:06 +0000 Subject: Use parse_boolean where possible. --- sway/commands/seat/fallback.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'sway/commands/seat') diff --git a/sway/commands/seat/fallback.c b/sway/commands/seat/fallback.c index 11f5a08c..a0ddf3ef 100644 --- a/sway/commands/seat/fallback.c +++ b/sway/commands/seat/fallback.c @@ -3,6 +3,7 @@ #include "sway/config.h" #include "sway/commands.h" #include "sway/input/input-manager.h" +#include "util.h" struct cmd_results *seat_cmd_fallback(int argc, char **argv) { struct cmd_results *error = NULL; @@ -16,16 +17,8 @@ struct cmd_results *seat_cmd_fallback(int argc, char **argv) { } struct seat_config *new_config = new_seat_config(current_seat_config->name); - - if (strcasecmp(argv[0], "true") == 0) { - new_config->fallback = 1; - } else if (strcasecmp(argv[0], "false") == 0) { - new_config->fallback = 0; - } else { - free_seat_config(new_config); - return cmd_results_new(CMD_INVALID, "fallback", - "Expected 'fallback '"); - } + + new_config->fallback = parse_boolean(argv[0], false); if (!config->validating) { apply_seat_config(new_config); -- cgit v1.2.3