From dacef46b03ed42db32adb0780a900449825153a7 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Tue, 10 Nov 2015 09:09:31 +0100 Subject: [PATCH 1/3] wget.c: replace deprecated gets with safe fgets --- examples/wget/wget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/wget/wget.c b/examples/wget/wget.c index 8a452771c..e8bff1063 100644 --- a/examples/wget/wget.c +++ b/examples/wget/wget.c @@ -169,14 +169,14 @@ PROCESS_THREAD(wget_process, ev, data) strcpy(url, contiki_argv[1]); puts(url); } else { - gets(url); + fgets(url, sizeof(url), stdin); } fputs("Save as:", stdout); if(contiki_argc > 2) { strcpy(name, contiki_argv[2]); puts(name); } else { - gets(name); + fgets(name, sizeof(name), stdin); } file = cfs_open(name, CFS_WRITE); if(file == -1) { From 4c52b87ac173ce24fce5831f1b27d82d631504fd Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Tue, 10 Nov 2015 09:30:36 +0100 Subject: [PATCH 2/3] Ported jn516x slip-bridge to new uip_fallback_interface --- examples/jn516x/rpl/border-router/slip-bridge.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/jn516x/rpl/border-router/slip-bridge.c b/examples/jn516x/rpl/border-router/slip-bridge.c index e3b0f814b..e79f80990 100644 --- a/examples/jn516x/rpl/border-router/slip-bridge.c +++ b/examples/jn516x/rpl/border-router/slip-bridge.c @@ -107,7 +107,7 @@ init(void) slip_set_input_callback(slip_input_callback); } /*---------------------------------------------------------------------------*/ -static void +static int output(void) { if(uip_ipaddr_cmp(&last_sender, &UIP_IP_BUF->srcipaddr)) { @@ -123,6 +123,7 @@ output(void) slip_send(); printf("\n"); } + return 0; } /*---------------------------------------------------------------------------*/ #if !SLIP_BRIDGE_CONF_NO_PUTCHAR From b5141f165c1a2d2252ccc1edc4714323c0b72b9f Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Tue, 10 Nov 2015 14:37:44 +0100 Subject: [PATCH 3/3] www.c: Explicitly declare itoa as it is non-standard and not necessarily in stdlib.h --- apps/webbrowser/www.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/webbrowser/www.c b/apps/webbrowser/www.c index 0f1be0ee8..f72dfcbfe 100644 --- a/apps/webbrowser/www.c +++ b/apps/webbrowser/www.c @@ -52,6 +52,8 @@ #include "www.h" +/* Explicitly declare itoa as it is non-standard and not necessarily in stdlib.h */ +char *itoa(int value, char *str, int base); /* The array that holds the current URL. */ static char url[WWW_CONF_MAX_URLLEN + 1];