You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by st...@apache.org on 2015/11/10 09:05:20 UTC

incubator-mynewt-larva git commit: cleanup some printfs and add a note about newlib evil.

Repository: incubator-mynewt-larva
Updated Branches:
  refs/heads/master 05f17db2a -> cc420b96d


cleanup some printfs and add a note about newlib evil.


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

Branch: refs/heads/master
Commit: cc420b96d4d58156fec3ca5800ef27eb287223c5
Parents: 05f17db
Author: Sterling Hughes <st...@apache.org>
Authored: Tue Nov 10 00:05:15 2015 -0800
Committer: Sterling Hughes <st...@apache.org>
Committed: Tue Nov 10 00:05:15 2015 -0800

----------------------------------------------------------------------
 libs/util/src/log.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/cc420b96/libs/util/src/log.c
----------------------------------------------------------------------
diff --git a/libs/util/src/log.c b/libs/util/src/log.c
index a898e22..c553673 100644
--- a/libs/util/src/log.c
+++ b/libs/util/src/log.c
@@ -47,24 +47,23 @@ shell_log_dump_entry(struct util_log *log, void *arg, void *dptr, uint16_t len)
     int dlen;
     int rc;
 
-    printf("Dumping shell!\n");
-
     rc = util_log_read(log, dptr, &ueh, 0, sizeof(ueh)); 
-    printf("rc = %d\n", rc);
     if (rc != sizeof(ueh)) {
         goto err;
     }
 
     dlen = min(len-sizeof(ueh), 128);
-    printf("Reading %d bytes of data\n", dlen);
 
     rc = util_log_read(log, dptr, data, sizeof(ueh), dlen);
-    printf("rc2 = %d, dlen = %d\n", rc, dlen);
     if (rc < 0) {
         goto err;
     }
     data[rc] = 0;
 
+    /* XXX: This is evil.  newlib printf does not like 64-bit 
+     * values, and this causes memory to be overwritten.  Cast to a 
+     * unsigned 32-bit value for now.
+     */
     console_printf("[%d] %s\n", (uint32_t) ueh.ue_ts, data);
 
     return (0);