mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-08 14:43:57 -04:00
GCS_MAVLink: Fix excess trimming of autopilot version
This commit is contained in:
parent
ab07bae8a6
commit
296c014d14
@ -2152,18 +2152,15 @@ void GCS_MAVLINK::send_autopilot_version() const
|
|||||||
(uint32_t)(version.fw_type) << (8 * 0);
|
(uint32_t)(version.fw_type) << (8 * 0);
|
||||||
|
|
||||||
if (version.fw_hash_str) {
|
if (version.fw_hash_str) {
|
||||||
strncpy(flight_custom_version, version.fw_hash_str, sizeof(flight_custom_version) - 1);
|
strncpy(flight_custom_version, version.fw_hash_str, ARRAY_SIZE(flight_custom_version));
|
||||||
flight_custom_version[sizeof(flight_custom_version) - 1] = '\0';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version.middleware_hash_str) {
|
if (version.middleware_hash_str) {
|
||||||
strncpy(middleware_custom_version, version.middleware_hash_str, sizeof(middleware_custom_version) - 1);
|
strncpy(middleware_custom_version, version.middleware_hash_str, ARRAY_SIZE(middleware_custom_version));
|
||||||
middleware_custom_version[sizeof(middleware_custom_version) - 1] = '\0';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version.os_hash_str) {
|
if (version.os_hash_str) {
|
||||||
strncpy(os_custom_version, version.os_hash_str, sizeof(os_custom_version) - 1);
|
strncpy(os_custom_version, version.os_hash_str, ARRAY_SIZE(os_custom_version));
|
||||||
os_custom_version[sizeof(os_custom_version) - 1] = '\0';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mavlink_msg_autopilot_version_send(
|
mavlink_msg_autopilot_version_send(
|
||||||
|
Loading…
Reference in New Issue
Block a user