mirror of
https://github.com/apache/nuttx.git
synced 2026-09-15 17:35:49 +08:00
serial.c: Fix an error in FIONWRITE calculation
This commit is contained in:
@@ -946,7 +946,7 @@ static int uart_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
/* Determine the number of bytes waiting in the TX buffer */
|
||||
|
||||
if (dev->xmit.head < dev->xmit.tail)
|
||||
if (dev->xmit.tail <= dev->xmit.head)
|
||||
{
|
||||
count = dev->xmit.head - dev->xmit.tail;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user