serial.c: Fix an error in FIONWRITE calculation
This commit is contained in:
parent
312e30026b
commit
eaaa69da0a
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue