diff options
author | tiptorrent development team <tiptorrent@soleta.eu> | 2022-02-10 15:29:02 +0100 |
---|---|---|
committer | tiptorrent development team <tiptorrent@soleta.eu> | 2022-02-10 15:29:02 +0100 |
commit | b377975a139a43907e1cee045a4ef3d589235dbd (patch) | |
tree | e70508159b964b397b4856b7c02e253585a368a3 | |
parent | 64d45f423711fb41aa5b8fbaae94d79838f54e69 (diff) |
fix -r/--redirect optional argument
-rw-r--r-- | src/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -67,8 +67,9 @@ int main(int argc, char *argv[]) } break; case 'r': - if (optarg) { - max_redirect = atoi(optarg); + if (optind < argc && + argv[optind][0] != '-') { + max_redirect = atoi(argv[optind++]); if (max_redirect <= 0) { syslog(LOG_ERR, "Invalid number for redirections"); return EXIT_FAILURE; |