Skip to content

Commit c2e9da9

Browse files
committed
AP_ADSB: correct copying of callsign in Sagetech XP ADSB driver
this appeared to be overwriting all of the data at the start of the mavlink packet, rather than overwriting the callsign within the packet.
1 parent 4d25361 commit c2e9da9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

libraries/AP_ADSB/AP_ADSB_Sagetech.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ void AP_ADSB_Sagetech::handle_adsb_in_msg(const Packet_XP &msg)
241241

242242
if (msg.payload[16] != 0) {
243243
// if string is non-null, consider it valid
244-
memcpy(&vehicle.info, &msg.payload[16], 8);
244+
memcpy(&vehicle.info.callsign, &msg.payload[16], ARRAY_SIZE(vehicle.info.callsign)-1); // "The callsign, 8+null" means we subtract one here
245245
vehicle.info.flags |= ADSB_FLAGS_VALID_CALLSIGN;
246246
}
247247

0 commit comments

Comments
 (0)