You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/10/12 20:53:56 UTC

incubator-mynewt-core git commit: Add missing null terminator to datetime json attrs

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop a11b8a2f2 -> b4ee0378c


Add missing null terminator to datetime json attrs

I also made the terminators more explicit on some other json attribute
arrays.  They were not broken; they were implicitly terminated.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/b4ee0378
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/b4ee0378
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/b4ee0378

Branch: refs/heads/develop
Commit: b4ee0378ce075aa1781e8f1a3c1aa34f4af0c8cf
Parents: a11b8a2
Author: Christopher Collins <cc...@apache.org>
Authored: Wed Oct 12 13:51:30 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Wed Oct 12 13:53:52 2016 -0700

----------------------------------------------------------------------
 mgmt/imgmgr/src/imgmgr.c              | 3 ++-
 mgmt/imgmgr/src/imgmgr_coredump.c     | 3 ++-
 mgmt/imgmgr/src/imgmgr_fs.c           | 6 ++++--
 mgmt/newtmgr/nmgr_os/src/newtmgr_os.c | 9 +++++----
 4 files changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/b4ee0378/mgmt/imgmgr/src/imgmgr.c
----------------------------------------------------------------------
diff --git a/mgmt/imgmgr/src/imgmgr.c b/mgmt/imgmgr/src/imgmgr.c
index ec8d09c..20c93af 100644
--- a/mgmt/imgmgr/src/imgmgr.c
+++ b/mgmt/imgmgr/src/imgmgr.c
@@ -321,7 +321,8 @@ imgr_upload(struct mgmt_jbuf *njb)
             .type = t_uinteger,
             .addr.uinteger = &size,
             .nodefault = true
-        }
+        },
+        [3] = { 0 },
     };
     struct image_version ver;
     struct image_header *hdr;

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/b4ee0378/mgmt/imgmgr/src/imgmgr_coredump.c
----------------------------------------------------------------------
diff --git a/mgmt/imgmgr/src/imgmgr_coredump.c b/mgmt/imgmgr/src/imgmgr_coredump.c
index b9d131a..72ae7c5 100644
--- a/mgmt/imgmgr/src/imgmgr_coredump.c
+++ b/mgmt/imgmgr/src/imgmgr_coredump.c
@@ -74,7 +74,8 @@ imgr_core_load(struct mgmt_jbuf *njb)
             .attribute = "off",
             .type = t_uinteger,
             .addr.uinteger = &off
-        }
+        },
+        [1] = { 0 },
     };
     int rc;
     int sz;

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/b4ee0378/mgmt/imgmgr/src/imgmgr_fs.c
----------------------------------------------------------------------
diff --git a/mgmt/imgmgr/src/imgmgr_fs.c b/mgmt/imgmgr/src/imgmgr_fs.c
index d44fd55..f7d603b 100644
--- a/mgmt/imgmgr/src/imgmgr_fs.c
+++ b/mgmt/imgmgr/src/imgmgr_fs.c
@@ -55,7 +55,8 @@ imgr_file_download(struct nmgr_jbuf *njb)
             .type = t_string,
             .addr.string = tmp_str,
             .len = sizeof(tmp_str)
-        }
+        },
+        [2] = { 0 },
     };
     int rc;
     uint32_t out_len;
@@ -148,7 +149,8 @@ imgr_file_upload(struct nmgr_jbuf *njb)
             .type = t_string,
             .addr.string = file_name,
             .len = sizeof(file_name)
-        }
+        },
+        [4] = { 0 },
     };
     struct json_encoder *enc;
     struct json_value jv;

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/b4ee0378/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
----------------------------------------------------------------------
diff --git a/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c b/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
index 1ce0ec3..4e772af 100644
--- a/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
+++ b/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
@@ -114,7 +114,8 @@ nmgr_def_console_echo(struct mgmt_jbuf *njb)
         },
         [1] = {
             .attribute = NULL
-        }
+        },
+        [2] = { 0 },
     };
 
     rc = json_read_object(&njb->mjb_buf, attrs);
@@ -258,7 +259,7 @@ nmgr_datetime_set(struct mgmt_jbuf *njb)
     struct json_value jv;
     char buf[DATETIME_BUFSIZE];
     int rc = OS_OK;
-    const struct json_attr_t datetime_write_attr[2] = {
+    const struct json_attr_t datetime_write_attr[3] = {
         [0] = {
             .attribute = "datetime",
             .type = t_string,
@@ -268,8 +269,8 @@ nmgr_datetime_set(struct mgmt_jbuf *njb)
         [1] = {
             .attribute = "rc",
             .type = t_uinteger,
-
-        }
+        },
+        { 0 },
     };
 
     rc = json_read_object(&njb->mjb_buf, datetime_write_attr);