vrahane commented on a change in pull request #420: sys/console: fix console 
compatibility
URL: https://github.com/apache/mynewt-core/pull/420#discussion_r127817517
 
 

 ##########
 File path: sys/console/minimal/src/console.c
 ##########
 @@ -86,11 +86,17 @@ console_read(char *str, int cnt, int *newline)
     }
     cmd = ev->ev_arg;
     len = strlen(cmd->line);
+
     if ((cnt - 1) < len) {
         len = cnt - 1;
+        if (len > 0) {
+            memcpy(str, cmd->line, len);
+            str[len] = '\0';
+        } else {
+            str[len] = cmd->line[0];
+        }
 
 Review comment:
   @michal-narajowski, I agree with @mkiiskila.  Can you remove changes to this 
file for the time being as it is going to break boot-serial. I will fix it in 
console/full and console/minimal and make sure it works with boot-serial as 
well. I will open a new PR with a fix to both.
 
----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to