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:
commit
2ffdf0f2a7
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user