Skip to content

Commit

Permalink
dtls-server.c: check for left cli-arguments.
Browse files Browse the repository at this point in the history
Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
  • Loading branch information
boaks committed May 13, 2024
1 parent 802e137 commit 4a6a782
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/dtls-server.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 4a6a782

Please sign in to comment.