projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Choose a different Port when 655 isn't available when doing "tinc join".
[tinc]
/
src
/
tincd.c
diff --git
a/src/tincd.c
b/src/tincd.c
index
333a207
..
5f1447e
100644
(file)
--- a/
src/tincd.c
+++ b/
src/tincd.c
@@
-167,7
+167,9
@@
static bool parse_options(int argc, char **argv) {
break;
#endif
break;
#endif
- case 'd': /* inc debug level */
+ case 'd': /* increase debug level */
+ if(!optarg && optind < argc && *argv[optind] != '-')
+ optarg = argv[optind++];
if(optarg)
debug_level = atoi(optarg);
else
if(optarg)
debug_level = atoi(optarg);
else
@@
-214,6
+216,8
@@
static bool parse_options(int argc, char **argv) {
case 4: /* write log entries to a file */
use_logfile = true;
case 4: /* write log entries to a file */
use_logfile = true;
+ if(!optarg && optind < argc && *argv[optind] != '-')
+ optarg = argv[optind++];
if(optarg)
logfilename = xstrdup(optarg);
break;
if(optarg)
logfilename = xstrdup(optarg);
break;
@@
-231,6
+235,12
@@
static bool parse_options(int argc, char **argv) {
}
}
}
}
+ if(optind < argc) {
+ fprintf(stderr, "%s: unrecognized argument '%s'\n", argv[0], argv[optind]);
+ usage(true);
+ return false;
+ }
+
if(!netname && (netname = getenv("NETNAME")))
netname = xstrdup(netname);
if(!netname && (netname = getenv("NETNAME")))
netname = xstrdup(netname);