mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-29 03:36:07 +08:00
Fix logic bug in ONLCR processing.
This commit is contained in:
@@ -328,7 +328,7 @@ static ssize_t uart_write(FAR struct file *filep, FAR const char *buffer, size_t
|
|||||||
/* If the ONLCR flag is set, we should translate \n to \r\n */
|
/* If the ONLCR flag is set, we should translate \n to \r\n */
|
||||||
|
|
||||||
ret = OK;
|
ret = OK;
|
||||||
if ((ch == '\n') && (dev->termios_s.c_oflag && ONLCR))
|
if ((ch == '\n') && (dev->termios_s.c_oflag & ONLCR))
|
||||||
{
|
{
|
||||||
ret = uart_putxmitchar(dev, '\r');
|
ret = uart_putxmitchar(dev, '\r');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user