Tools: fixed vsnprintf assumption in AP_Bootloader

This commit is contained in:
Andrew Tridgell 2019-09-11 17:45:25 +10:00
parent bc0b9337a0
commit d9e3a01e57

View File

@ -274,7 +274,7 @@ void uprintf(const char *fmt, ...)
va_start(ap, fmt);
uint32_t n = vsnprintf(umsg, sizeof(umsg), fmt, ap);
va_end(ap);
chnWriteTimeout(&BOOTLOADER_DEBUG, (const uint8_t *)umsg, n, chTimeMS2I(100));
chnWriteTimeout(&BOOTLOADER_DEBUG, (const uint8_t *)umsg, MIN(n,sizeof(umsg)), chTimeMS2I(100));
#endif
}