You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/08/18 19:26:41 UTC

[1/2] incubator-mynewt-core git commit: sys/config: Fix returning long config values to newtmgr

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop c0f685b40 -> 5de9a7263


sys/config: Fix returning long config values to newtmgr


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/785dd5de
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/785dd5de
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/785dd5de

Branch: refs/heads/develop
Commit: 785dd5de6de7a748eda6efa9099f44841f096ef1
Parents: 60d6285
Author: Simon Ratner <si...@probablyprime.net>
Authored: Fri Jul 29 23:58:02 2016 -0700
Committer: Simon Ratner <si...@probablyprime.net>
Committed: Sat Jul 30 02:04:18 2016 -0700

----------------------------------------------------------------------
 sys/config/src/config_nmgr.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/785dd5de/sys/config/src/config_nmgr.c
----------------------------------------------------------------------
diff --git a/sys/config/src/config_nmgr.c b/sys/config/src/config_nmgr.c
index ae4aa11..b6019a7 100644
--- a/sys/config/src/config_nmgr.c
+++ b/sys/config/src/config_nmgr.c
@@ -43,34 +43,36 @@ static struct nmgr_group conf_nmgr_group = {
 static int
 conf_nmgr_read(struct nmgr_jbuf *njb)
 {
-    char tmp_str[CONF_MAX_NAME_LEN];
-    char *val_str;
+    int rc;
+    char name_str[CONF_MAX_NAME_LEN];
+    char val_str[CONF_MAX_VAL_LEN];
+    char *val;
+
     const struct json_attr_t attr[2] = {
         [0] = {
             .attribute = "name",
             .type = t_string,
-            .addr.string = tmp_str,
-            .len = sizeof(tmp_str)
+            .addr.string = name_str,
+            .len = sizeof(name_str)
         },
         [1] = {
             .attribute = NULL
         }
     };
     struct json_value jv;
-    int rc;
 
     rc = json_read_object(&njb->njb_buf, attr);
     if (rc) {
         return OS_EINVAL;
     }
 
-    val_str = conf_get_value(tmp_str, tmp_str, sizeof(tmp_str));
-    if (!val_str) {
+    val = conf_get_value(name_str, val_str, sizeof(val_str));
+    if (!val) {
         return OS_EINVAL;
     }
 
     json_encode_object_start(&njb->njb_enc);
-    JSON_VALUE_STRING(&jv, val_str);
+    JSON_VALUE_STRING(&jv, val);
     json_encode_object_entry(&njb->njb_enc, "val", &jv);
     json_encode_object_finish(&njb->njb_enc);
 


[2/2] incubator-mynewt-core git commit: This closes #86.

Posted by ma...@apache.org.
This closes #86.

Merge branch 'fix/nmgr-config' of https://github.com/simonratner/incubator-mynewt-core into develop


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/5de9a726
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/5de9a726
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/5de9a726

Branch: refs/heads/develop
Commit: 5de9a7263153f357dcf65378ebf93ab4f55683a9
Parents: c0f685b 785dd5d
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Aug 18 10:39:44 2016 -0700
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Thu Aug 18 10:39:44 2016 -0700

----------------------------------------------------------------------
 sys/config/src/config_nmgr.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------