mirror of https://github.com/ArduPilot/ardupilot
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:
parent
fa3b3964e8
commit
4db9a5e6fe
|
@ -154,7 +154,7 @@ size_t UARTDriver::write(uint8_t c)
|
||||||
|
|
||||||
size_t UARTDriver::write(const uint8_t *buffer, size_t size)
|
size_t UARTDriver::write(const uint8_t *buffer, size_t size)
|
||||||
{
|
{
|
||||||
if (txspace() <= (ssize_t)size) {
|
if (txspace() <= size) {
|
||||||
size = txspace();
|
size = txspace();
|
||||||
}
|
}
|
||||||
if (size <= 0) {
|
if (size <= 0) {
|
||||||
|
|
Loading…
Reference in New Issue