removed warning about unsigned to signed cast

Jimmy Brisson 2016-05-17 13:35:24 -05:00
parent cde78ec095
commit 59ed1bef61
1 changed files with 4 additions and 2 deletions

View File

@ -89,13 +89,15 @@ int BufferedSerial::printf(const char* format, ...)
va_start(arg, format);
r = vsprintf(buffer, format, arg);
// this may not hit the heap but should alert the user anyways
if(r > this->_buf_size) {
if(r > (int32_t) this->_buf_size) {
error("%s %d buffer overwrite (max_buf_size: %d exceeded: %d)!\r\n", __FILE__, __LINE__,this->_buf_size,r);
va_end(arg);
return 0;
}
va_end(arg);
r = BufferedSerial::write(buffer, r);
if ( r > 0 ) {
r = BufferedSerial::write(buffer, r);
}
return r;
}