fix -r/--redirect optional argument
parent
64d45f4237
commit
b377975a13
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue