1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 12:55:19 +03:00

Added assertion about OSD warning field size. (#5533)

This commit is contained in:
Michael Keller 2018-03-26 20:53:12 +13:00 committed by GitHub
parent 4b20ab5d7b
commit 3a8901daa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -626,6 +626,8 @@ static bool osdDrawSingleElement(uint8_t item)
#define OSD_WARNINGS_MAX_SIZE 11
#define OSD_FORMAT_MESSAGE_BUFFER_SIZE (OSD_WARNINGS_MAX_SIZE + 1)
STATIC_ASSERT(OSD_FORMAT_MESSAGE_BUFFER_SIZE <= sizeof(buff), osd_warnings_size_exceeds_buffer_size);
const uint16_t enabledWarnings = osdConfig()->enabledWarnings;
const batteryState_e batteryState = getBatteryState();