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 <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
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 {