mirror of
https://github.com/eclipse/tinydtls.git
synced 2025-10-14 03:10:09 +08:00
dtls-server.c: check for left cli-arguments.
Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
This commit is contained in:
@@ -308,7 +308,7 @@ usage(const char *program, const char *version) {
|
||||
program = ++p;
|
||||
|
||||
fprintf(stderr, "%s v%s -- DTLS server implementation\n"
|
||||
"(c) 2011-2014 Olaf Bergmann <bergmann@tzi.org>\n\n"
|
||||
"(c) 2011-2024 Olaf Bergmann <bergmann@tzi.org>\n\n"
|
||||
"usage: %s [-A address] [-c cipher suites] [-e] [-p port] [-r] [-v num]\n"
|
||||
"\t-A address\t\tlisten on specified address (default is ::)\n",
|
||||
program, version, program);
|
||||
@@ -386,6 +386,11 @@ main(int argc, char **argv) {
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
if (argc != optind) {
|
||||
dtls_warn("no arguments supported!\n");
|
||||
usage(argv[0], dtls_package_version());
|
||||
exit(1);
|
||||
}
|
||||
listen_addr.sin6_port = port;
|
||||
|
||||
dtls_set_log_level(log_level);
|
||||
|
Reference in New Issue
Block a user