AP_HAL_SITL: remove cast to signed type

... we're currently taking an unsigned type, casting it to a signed type
and then comparing the result of that to an unsigned type.  That's
unhealthy.
This commit is contained in:
Peter Barker 2018-04-03 13:21:59 +10:00 committed by Francisco Ferreira
parent fa3b3964e8
commit 4db9a5e6fe
1 changed files with 1 additions and 1 deletions

View File

@ -154,7 +154,7 @@ size_t UARTDriver::write(uint8_t c)
size_t UARTDriver::write(const uint8_t *buffer, size_t size)
{
if (txspace() <= (ssize_t)size) {
if (txspace() <= size) {
size = txspace();
}
if (size <= 0) {