Merge branch 'develop' into infinite-ka-fix

This commit is contained in:
Simon Duquennoy 2018-03-23 19:01:19 +01:00 committed by GitHub
commit 35bcaeb828
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 23 deletions

View File

@ -218,8 +218,11 @@ PT_THREAD(cmd_ping(struct pt *pt, shell_output_func output, char *args))
/* Get argument (remote IPv6) */
SHELL_ARGS_NEXT(args, next_args);
if(uiplib_ipaddrconv(args, &remote_addr) == 0) {
SHELL_OUTPUT(output, "Invalid IPv6: %s\n", args);
if(args == NULL) {
SHELL_OUTPUT(output, "Destination IPv6 address is not specified\n");
PT_EXIT(pt);
} else if(uiplib_ipaddrconv(args, &remote_addr) == 0) {
SHELL_OUTPUT(output, "Invalid IPv6 address: %s\n", args);
PT_EXIT(pt);
}

View File

@ -70,7 +70,7 @@
/* Printf-formatted output via a given output function */
#define SHELL_OUTPUT(output_func, format, ...) do { \
char buffer[128]; \
char buffer[192]; \
snprintf(buffer, sizeof(buffer), format, ##__VA_ARGS__); \
(output_func)(buffer); \
} while(0);