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 2018/10/18 16:39:20 UTC

[GitHub] mkiiskila commented on a change in pull request #1439: test/runtest: Null-terminate segments of log entry

mkiiskila commented on a change in pull request #1439: test/runtest: Null-terminate segments of log entry
URL: https://github.com/apache/mynewt-core/pull/1439#discussion_r226380802
 
 

 ##########
 File path: test/runtest/src/runtest.c
 ##########
 @@ -165,34 +165,39 @@ runtest_log_result(const char *msg, bool passed)
     int m_len;
     int len;
 
-    /* str length of {"k":"","n":"","s":"","m":"","r":1}<token> */
-    len = 35 + strlen(runtest_token);
+    /* str length of {"k":"","n":"","s":"","m":"","r":1}<token> plus three
+     * null-terminators.
+     */
+    len = 38 + strlen(runtest_token);
 
     /* How much of the test name can we log? */
     n_len = strlen(tu_case_name);
-    if (len + n_len >= LOG_PRINTF_MAX_ENTRY_LEN) {
-        n_len = LOG_PRINTF_MAX_ENTRY_LEN - len - 1;
+    if (len + n_len >= MYNEWT_VAL(MODLOG_MAX_PRINTF_LEN)) {
 
 Review comment:
   I would've added a #define MODLOG_MAX_PRINTF_LEN MYNEWT_VAL(MODLOG_MAX_PRINTF_LEN) in the beginning of the file to shorten these lines :) But this is ok.

----------------------------------------------------------------
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