diff options
author | Thomas Albers Raviola <thomas@thomaslabs.org> | 2023-08-28 22:08:46 +0200 |
---|---|---|
committer | Thomas Albers Raviola <thomas@thomaslabs.org> | 2023-08-28 22:08:46 +0200 |
commit | 9c826f6f1a652edce0c8bb15b0cf94e259296e53 (patch) | |
tree | 6c7063856d6ac165dd4329694a54c79813cc3afb /zup.c | |
parent | 3199529ab3ed39737454f9f0b4e91915955c38b2 (diff) |
Add delay between attempts
Diffstat (limited to 'zup.c')
-rw-r--r-- | zup.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -128,7 +128,7 @@ parse_options(int argc, char *const argv[]) case 'a': errno = 0; param.max_attempts = strtoul(optarg, NULL, 10); - if (errno) { + if (errno || !optarg || strlen(optarg) == 0) { perror("Invalid attempts number\n"); exit(EXIT_FAILURE); } @@ -232,7 +232,8 @@ struct param param = { .verbose = 0, .human_readable = 0, .repl = 0, - .show_progress = 0 + .show_progress = 0, + .max_attempts = 5 }; // TODO: Support stdin/stdout |