Browse Source

AP_OSD: fixed vsnprintf return assumption

master
Andrew Tridgell 5 years ago
parent
commit
6af9d55e70
  1. 1
      libraries/AP_OSD/AP_OSD_Backend.cpp

1
libraries/AP_OSD/AP_OSD_Backend.cpp

@ -32,6 +32,7 @@ void AP_OSD_Backend::write(uint8_t x, uint8_t y, bool blink, const char *fmt, .. @@ -32,6 +32,7 @@ void AP_OSD_Backend::write(uint8_t x, uint8_t y, bool blink, const char *fmt, ..
va_list ap;
va_start(ap, fmt);
int res = hal.util->vsnprintf(buff, sizeof(buff), fmt, ap);
res = MIN(res, int(sizeof(buff)));
if (res > 0 && check_option(AP_OSD::OPTION_DECIMAL_PACK)) {
// automatically use packed decimal characters
// based on fiam idea implemented in inav osd

Loading…
Cancel
Save