diff options
author | Konstantin Pereiaslov <perk11@perk11.info> | 2024-01-01 17:51:47 -0600 |
---|---|---|
committer | Konstantin Pereiaslov <perk11@perk11.info> | 2024-01-01 17:51:47 -0600 |
commit | a94e9e0ad5368f0b0961605234f4fd0824d8785c (patch) | |
tree | 252ba425eb46242277a84763297631ae0b7220dc | |
parent | 7b0294558cc3add381a58a1018ee6d97d031ec71 (diff) |
Update switch syntax to delineate blocks with variable declarations in them
-rw-r--r-- | arguments_parsing.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arguments_parsing.c b/arguments_parsing.c index fc25e32..1ffcc5f 100644 --- a/arguments_parsing.c +++ b/arguments_parsing.c @@ -84,7 +84,7 @@ char *parse_command_line_arguments(int argc, char *argv[]) { int option; while ((option = getopt_long(argc, argv, "+hvqt:a:m:V", long_options, NULL)) != -1) { switch (option) { - case 't': + case 't': { long timeout_arg_value = strtol(optarg, NULL, 10); if (timeout_arg_value < TIMEOUT_MIN_SUPPORTED_VALUE || timeout_arg_value > TIMEOUT_MAX_SUPPORTED_VALUE || errno != 0) { @@ -95,6 +95,7 @@ char *parse_command_line_arguments(int argc, char *argv[]) { } user_idle_timeout_ms = timeout_arg_value * 1000; break; + } case 'a': start_monitor_after_ms = strtol(optarg, NULL, 10); @@ -106,7 +107,7 @@ char *parse_command_line_arguments(int argc, char *argv[]) { exit(1); } break; - case 'm': + case 'm': { char *method = strdup(optarg); for (int i = 0; i < sizeof(method); i++) { method[i] = toupper(method[i]); @@ -130,6 +131,7 @@ char *parse_command_line_arguments(int argc, char *argv[]) { exit(1); } break; + } case 'V': print_version(); exit(0); |