You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by je...@apache.org on 2020/09/30 06:22:25 UTC

[incubator-nuttx-apps] branch master updated (5e1ba40 -> 39a1950)

This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git.


    from 5e1ba40  Add IPv4 Configuration File Access Helper
     new b78370d  webclient: move WGET_USE_URLENCODE definiton to the header
     new b5d7004a examples/wgetjson/Kconfig: fix a typo
     new b05a1f6  wgetjson_json_item_scan: fix a NULL dereference
     new 39a1950  wgetjson: Fix a super confusing printf message

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 examples/wgetjson/Kconfig         | 2 +-
 examples/wgetjson/wgetjson_main.c | 9 +++++----
 include/netutils/webclient.h      | 6 ++++++
 netutils/webclient/webclient.c    | 1 -
 4 files changed, 12 insertions(+), 6 deletions(-)


[incubator-nuttx-apps] 02/04: examples/wgetjson/Kconfig: fix a typo

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit b5d7004a8d069db616c9bc95890ce19ff5ab834f
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Tue Sep 29 16:13:01 2020 +0900

    examples/wgetjson/Kconfig: fix a typo
---
 examples/wgetjson/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/wgetjson/Kconfig b/examples/wgetjson/Kconfig
index 9e29ee9..257fbcd 100644
--- a/examples/wgetjson/Kconfig
+++ b/examples/wgetjson/Kconfig
@@ -6,7 +6,7 @@
 config EXAMPLES_WGETJSON
 	tristate "wget JSON Example"
 	default n
-	depends on NETUTILS_JSON
+	depends on NETUTILS_CJSON
 	---help---
 		Enable the wget JSON example
 


[incubator-nuttx-apps] 04/04: wgetjson: Fix a super confusing printf message

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 39a1950098b331c5a2c203431ffc26f276274863
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Tue Sep 29 16:40:53 2020 +0900

    wgetjson: Fix a super confusing printf message
---
 examples/wgetjson/wgetjson_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/wgetjson/wgetjson_main.c b/examples/wgetjson/wgetjson_main.c
index 99c2ccc..2a4bd33 100644
--- a/examples/wgetjson/wgetjson_main.c
+++ b/examples/wgetjson/wgetjson_main.c
@@ -381,11 +381,10 @@ int main(int argc, FAR char *argv[])
   buffer = malloc(buffer_len);
   wgetjson_json_release();
 
-  printf("URL: %s\n", url);
-
   if (is_post)
     {
       url = CONFIG_EXAMPLES_WGETPOST_URL;
+      printf("URL: %s\n", url);
       if (is_post_multi)
         {
           post_buff_len = web_posts_strlen(post_multi_names,
@@ -411,6 +410,7 @@ int main(int argc, FAR char *argv[])
     }
   else
     {
+      printf("URL: %s\n", url);
       ret = wget(url, buffer, buffer_len, wget_cb , NULL);
     }
 


[incubator-nuttx-apps] 03/04: wgetjson_json_item_scan: fix a NULL dereference

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit b05a1f61e2fcc4238acea345d94c5abc6dc93b1b
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Tue Sep 29 16:37:18 2020 +0900

    wgetjson_json_item_scan: fix a NULL dereference
    
    I'm not sure if this is the correct fix.
    wgetjson_json_item_callback seems to expect it to be formatted
    as "(null)".
---
 examples/wgetjson/wgetjson_main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/examples/wgetjson/wgetjson_main.c b/examples/wgetjson/wgetjson_main.c
index 81ccf02..99c2ccc 100644
--- a/examples/wgetjson/wgetjson_main.c
+++ b/examples/wgetjson/wgetjson_main.c
@@ -260,8 +260,9 @@ static void wgetjson_json_item_scan(cJSON *item, const char *prefix)
 
   while (item)
     {
-      newprefix = malloc(strlen(prefix) + strlen(item->string) + 2);
-      sprintf(newprefix, "%s/%s", prefix, item->string);
+      const char *string = item->string ? item->string : "(null)";
+      newprefix = malloc(strlen(prefix) + strlen(string) + 2);
+      sprintf(newprefix, "%s/%s", prefix, string);
 
       dorecurse = wgetjson_json_item_callback(newprefix, item->type, item);
       if (item->child && dorecurse)


[incubator-nuttx-apps] 01/04: webclient: move WGET_USE_URLENCODE definiton to the header

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit b78370dbf2475e3ce31dc93d703dc704e32e34a1
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Tue Sep 29 16:56:56 2020 +0900

    webclient: move WGET_USE_URLENCODE definiton to the header
    
    Because it's used by the header.
    
    This fixes warnings while building wgetjson.
---
 include/netutils/webclient.h   | 6 ++++++
 netutils/webclient/webclient.c | 1 -
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/netutils/webclient.h b/include/netutils/webclient.h
index f53ed46..bdf05b3 100644
--- a/include/netutils/webclient.h
+++ b/include/netutils/webclient.h
@@ -69,6 +69,12 @@
 #  define CONFIG_WEBCLIENT_MAXFILENAME 100
 #endif
 
+#if defined(CONFIG_NETUTILS_CODECS)
+#  if defined(CONFIG_CODECS_URLCODE)
+#    define WGET_USE_URLENCODE 1
+#  endif
+#endif
+
 /****************************************************************************
  * Public types
  ****************************************************************************/
diff --git a/netutils/webclient/webclient.c b/netutils/webclient/webclient.c
index 0a70d0e..1bb67c1 100644
--- a/netutils/webclient/webclient.c
+++ b/netutils/webclient/webclient.c
@@ -75,7 +75,6 @@
 
 #if defined(CONFIG_NETUTILS_CODECS)
 #  if defined(CONFIG_CODECS_URLCODE)
-#    define WGET_USE_URLENCODE 1
 #    include "netutils/urldecode.h"
 #  endif
 #  if defined(CONFIG_CODECS_BASE64)