summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 3d776b7..65b68fc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -54,7 +54,7 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
while (1) {
- val = getopt_long(argc, argv, "n:r::d", tip_repo_opts, NULL);
+ val = getopt_long(argc, argv, "n:t:r::d", tip_repo_opts, NULL);
if (val < 0)
break;
@@ -67,16 +67,18 @@ int main(int argc, char *argv[])
}
break;
case 'r':
- if (optind < argc &&
+ if (optarg) {
+ max_redirect = atoi(optarg);
+ } else 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;
- }
} else {
max_redirect = max_clients;
}
+ if (max_redirect < 0) {
+ syslog(LOG_ERR, "Invalid number for redirections");
+ return EXIT_FAILURE;
+ }
break;
case 't':
root = strdup(optarg);