serial.c: Fix an error in FIONWRITE calculation

This commit is contained in:
Gregory Nutt 2016-07-26 06:47:53 -06:00
parent 312e30026b
commit eaaa69da0a
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}