You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/01/04 13:36:20 UTC

[GitHub] andrzej-kaczmarek closed pull request #1587: sys/log: Fix endianess in CBOR pretty-printing

andrzej-kaczmarek closed pull request #1587: sys/log: Fix endianess in CBOR pretty-printing
URL: https://github.com/apache/mynewt-core/pull/1587
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/sys/log/full/src/log_shell.c b/sys/log/full/src/log_shell.c
index b47e82f857..40ffc3ab85 100644
--- a/sys/log/full/src/log_shell.c
+++ b/sys/log/full/src/log_shell.c
@@ -38,6 +38,7 @@
 #include "base64/hex.h"
 #if MYNEWT_VAL(LOG_VERSION) > 2
 #include "tinycbor/cbor.h"
+#include "tinycbor/compilersupport_p.h"
 #endif
 
 #if MYNEWT_VAL(LOG_VERSION) > 2
@@ -66,7 +67,7 @@ log_shell_cbor_reader_get16(struct cbor_decoder_reader *d, int offset)
 
     (void)log_read_body(cbr->log, cbr->dptr, &val, offset, sizeof(val));
 
-    return val;
+    return cbor_ntohs(val);
 }
 
 static uint32_t
@@ -77,7 +78,7 @@ log_shell_cbor_reader_get32(struct cbor_decoder_reader *d, int offset)
 
     (void)log_read_body(cbr->log, cbr->dptr, &val, offset, sizeof(val));
 
-    return val;
+    return cbor_ntohl(val);
 }
 
 static uint64_t
@@ -88,7 +89,7 @@ log_shell_cbor_reader_get64(struct cbor_decoder_reader *d, int offset)
 
     (void)log_read_body(cbr->log, cbr->dptr, &val, offset, sizeof(val));
 
-    return val;
+    return cbor_ntohll(val);
 }
 
 static uintptr_t


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services