From 40daa8e15f6bec27581101ecc6fcfa06ed406437 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 6 Sep 2018 13:31:25 +1000 Subject: [PATCH] AP_GPS: use mavlink definition to get statustext size Also, add one for null-termination --- libraries/AP_GPS/GPS_Backend.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_GPS/GPS_Backend.cpp b/libraries/AP_GPS/GPS_Backend.cpp index 64f9b145fa..a129c4dbc5 100644 --- a/libraries/AP_GPS/GPS_Backend.cpp +++ b/libraries/AP_GPS/GPS_Backend.cpp @@ -158,14 +158,14 @@ void AP_GPS_Backend::_detection_message(char *buffer, const uint8_t buflen) cons void AP_GPS_Backend::broadcast_gps_type() const { - char buffer[64]; + char buffer[MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN+1]; _detection_message(buffer, sizeof(buffer)); gcs().send_text(MAV_SEVERITY_INFO, buffer); } void AP_GPS_Backend::Write_DataFlash_Log_Startup_messages() const { - char buffer[64]; + char buffer[MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN+1]; _detection_message(buffer, sizeof(buffer)); DataFlash_Class::instance()->Log_Write_Message(buffer); }