AP_ADSB: fix snprintf warning

This commit is contained in:
Pierre Kancir 2018-05-25 17:38:50 +02:00 committed by Tom Pittenger
parent a1fd1cb9b2
commit 9ada804489

View File

@ -639,7 +639,7 @@ uint8_t AP_ADSB::get_encoded_callsign_null_char()
// using the above logic, we must always assign the squawk. once we get configured
// externally then get_encoded_callsign_null_char() stops getting called
snprintf(out_state.cfg.callsign, 4, "%04d", unsigned(out_state.cfg.squawk_octal));
snprintf(out_state.cfg.callsign, 5, "%04d", unsigned(out_state.cfg.squawk_octal));
memset(&out_state.cfg.callsign[4], 0, 5); // clear remaining 5 chars
encoded_null |= 0x40;