mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 02:18:29 -04:00
GCS_MAVLink: prevent asan errors in send_text_all
This commit is contained in:
parent
a566ebe4ec
commit
c750cbebfb
@ -1152,17 +1152,11 @@ void GCS_MAVLINK::send_statustext_all(const prog_char_t *msg)
|
||||
if ((1U<<i) & mavlink_active) {
|
||||
mavlink_channel_t chan = (mavlink_channel_t)i;
|
||||
if (comm_get_txspace(chan) >= MAVLINK_NUM_NON_PAYLOAD_BYTES + MAVLINK_MSG_ID_STATUSTEXT_LEN) {
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_APM1 || CONFIG_HAL_BOARD == HAL_BOARD_APM2
|
||||
char msg2[50];
|
||||
strncpy_P(msg2, msg, sizeof(msg2));
|
||||
mavlink_msg_statustext_send(chan,
|
||||
SEVERITY_HIGH,
|
||||
msg2);
|
||||
#else
|
||||
mavlink_msg_statustext_send(chan,
|
||||
SEVERITY_HIGH,
|
||||
msg);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user