mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 00:28:30 -04:00
GCS_MAVLink: account for snprintf now null-terminating strings
This commit is contained in:
parent
4c794ebba3
commit
96b5be0e7d
@ -7,8 +7,8 @@ extern const AP_HAL::HAL& hal;
|
||||
*/
|
||||
void GCS::send_textv(MAV_SEVERITY severity, const char *fmt, va_list arg_list)
|
||||
{
|
||||
char text[MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN+1] {};
|
||||
hal.util->vsnprintf((char *)text, sizeof(text)-1, fmt, arg_list);
|
||||
char text[MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN+1];
|
||||
hal.util->vsnprintf(text, sizeof(text), fmt, arg_list);
|
||||
send_statustext(severity, GCS_MAVLINK::active_channel_mask() | GCS_MAVLINK::streaming_channel_mask(), text);
|
||||
}
|
||||
|
||||
|
@ -628,8 +628,8 @@ void GCS_MAVLINK::handle_gimbal_report(AP_Mount &mount, mavlink_message_t *msg)
|
||||
|
||||
void GCS_MAVLINK::send_textv(MAV_SEVERITY severity, const char *fmt, va_list arg_list)
|
||||
{
|
||||
char text[MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN+1] {};
|
||||
hal.util->vsnprintf((char *)text, sizeof(text)-1, fmt, arg_list);
|
||||
char text[MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN+1];
|
||||
hal.util->vsnprintf(text, sizeof(text), fmt, arg_list);
|
||||
gcs().send_statustext(severity, (1<<chan), text);
|
||||
}
|
||||
void GCS_MAVLINK::send_text(MAV_SEVERITY severity, const char *fmt, ...)
|
||||
|
Loading…
Reference in New Issue
Block a user