From 0cb81928616ed40241db3a414f6fc344ca582876 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 11 Jan 2013 10:32:52 +1100 Subject: [PATCH] HAL_AVR: ensure we can handle a 256 size buffer --- libraries/AP_HAL_AVR/UARTDriver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_HAL_AVR/UARTDriver.cpp b/libraries/AP_HAL_AVR/UARTDriver.cpp index 3c6410789b..454fee9028 100644 --- a/libraries/AP_HAL_AVR/UARTDriver.cpp +++ b/libraries/AP_HAL_AVR/UARTDriver.cpp @@ -241,7 +241,7 @@ bool AVRUARTDriver::_allocBuffer(Buffer *buffer, uint16_t size) buffer->mask = mask; // allocate memory for the buffer - if this fails, we fail. - buffer->bytes = (uint8_t *) malloc(buffer->mask + 1); + buffer->bytes = (uint8_t *) malloc(buffer->mask + (size_t)1); return (buffer->bytes != NULL); }