diff --git a/libraries/AP_ADSB/AP_ADSB.cpp b/libraries/AP_ADSB/AP_ADSB.cpp index 518bb969b3..428a61ae34 100644 --- a/libraries/AP_ADSB/AP_ADSB.cpp +++ b/libraries/AP_ADSB/AP_ADSB.cpp @@ -640,7 +640,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, 5, "%04d", unsigned(out_state.cfg.squawk_octal)); + snprintf(out_state.cfg.callsign, 5, "%04d", unsigned(out_state.cfg.squawk_octal) & 0x1FFF); memset(&out_state.cfg.callsign[4], 0, 5); // clear remaining 5 chars encoded_null |= 0x40;