diff options
| author | Pali Rohár <[email protected]> | 2021-02-07 14:50:01 +0100 |
|---|---|---|
| committer | Marek Vasut <[email protected]> | 2021-03-03 04:12:45 +0100 |
| commit | d3fb8fee7d8225845cedfd0b9d23b2a8d6f8c6ee (patch) | |
| tree | f03d0af72e50c544a089f500d14df4671f1ec464 /drivers | |
| parent | 78af81c345430a9088235f48d302922955d2499f (diff) | |
serial: usbtty: Fix puts function
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]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/serial/usbtty.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c index f1c1a260da5..02f8edf200c 100644 --- a/drivers/serial/usbtty.c +++ b/drivers/serial/usbtty.c @@ -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 { |
