Fix logic bug in ONLCR processing.

This commit is contained in:
px4dev
2012-11-02 00:10:10 -07:00
parent 5e1416178a
commit 9b509310e6
+1 -1
View File
@@ -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');
} }