From 4db9a5e6fe3836b8d65618d8c1b6282f57743fb4 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 3 Apr 2018 13:21:59 +1000 Subject: [PATCH] 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. --- libraries/AP_HAL_SITL/UARTDriver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_HAL_SITL/UARTDriver.cpp b/libraries/AP_HAL_SITL/UARTDriver.cpp index 9634b237be..053519e1f4 100644 --- a/libraries/AP_HAL_SITL/UARTDriver.cpp +++ b/libraries/AP_HAL_SITL/UARTDriver.cpp @@ -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) {