ccollins476ad commented on a change in pull request #1778: sys/log/full: Allow 
for limiting size of newtmgr log response
URL: https://github.com/apache/mynewt-core/pull/1778#discussion_r277744145
 
 

 ##########
 File path: sys/log/full/src/log_nmgr.c
 ##########
 @@ -220,18 +247,29 @@ log_nmgr_encode_entry(struct log *log, struct log_offset 
*log_offset,
      * inside.
      */
     g_err |= cbor_encoder_create_indef_byte_string(&rsp, &str_encoder);
-    for (off = 0; off < len && !g_err; ) {
-        rc = log_read_body(log, dptr, data, off, sizeof(data));
-        if (rc < 0) {
-            g_err |= 1;
-            break;
-        }
+    if (too_long) {
+        data[0] = 0;
 
 Review comment:
   This line (`data[0] = 0;`) is not necessary, is it?  `sprintf()` always 
null-terminates the destination string, so I think this can be removed.  This 
same comment applies to the deprecated `LOG_VERSION` case below.

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


With regards,
Apache Git Services

Reply via email to