1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #6046 from miri64/examples/fix/dtls-off-by-one

examples: fix off-by-one error in TinyDTLS example
This commit is contained in:
Martine Lenders 2016-11-03 15:27:07 +01:00 committed by GitHub
commit 2ffdf0f2a7
2 changed files with 5 additions and 10 deletions

View File

@ -502,18 +502,13 @@ static void client_send(char *addr_str, char *data, unsigned int delay)
int udp_client_cmd(int argc, char **argv)
{
if (argc < 2) {
uint32_t delay = 1000000;
if (argc < 3) {
printf("usage: %s <addr> <data> [<delay in us>]\n", argv[0]);
return 1;
}
uint32_t delay = 1000000;
if (argc < 3) {
printf("usage: %s <addr> <data> [<delay in us>]\n",
argv[0]);
return 1;
}
if (argc > 3) {
else if (argc > 3) {
delay = (uint32_t)atoi(argv[3]);
}
client_send(argv[1], argv[2], delay);

View File

@ -435,7 +435,7 @@ static void stop_server(void)
int udp_server_cmd(int argc, char **argv)
{
if (argc < 1) {
if (argc < 2) {
printf("usage: %s start|stop\n", argv[0]);
return 1;
}