]> Git Repo - u-boot.git/commitdiff
serial: usbtty: Fix puts function
authorPali Rohár <[email protected]>
Sun, 7 Feb 2021 13:50:01 +0000 (14:50 +0100)
committerMarek Vasut <[email protected]>
Wed, 3 Mar 2021 03:12:45 +0000 (04:12 +0100)
This function has incorrect implementation of prepending CR prior LF.
Without this patch it prepended CR prior whole string which is going to be
written and let LF without leading CR. Fix this issue by inserting CR at
correct place to make output on usbtty serial console more readable.

Signed-off-by: Pali Rohár <[email protected]>
Reviewed-by: Lukasz Majewski <[email protected]>
Acked-by: Pavel Machek <[email protected]>
drivers/serial/usbtty.c

index f1c1a260da5191b7b950e3325be6735e6904b413..02f8edf200c8ce74e5c65cd3124014c1de23e95a 100644 (file)
@@ -500,8 +500,8 @@ void usbtty_puts(struct stdio_dev *dev, const char *str)
                n = next_nl_pos (str);
 
                if (str[n] == '\n') {
-                       __usbtty_puts("\r", 1);
-                       __usbtty_puts(str, n + 1);
+                       __usbtty_puts(str, n);
+                       __usbtty_puts("\r\n", 2);
                        str += (n + 1);
                        len -= (n + 1);
                } else {
This page took 0.0376 seconds and 4 git commands to generate.