mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-06 16:58:48 +08:00
[mavlink] NULL terminated strings instead of len field
This commit is contained in:
@@ -50,9 +50,12 @@ void mavlink_send_block(uint16_t seq)
|
||||
static const char *blocks[] = FP_BLOCKS;
|
||||
char block_name[50];
|
||||
strncpy(block_name, blocks[seq], 49); // String containing the name of the block
|
||||
uint8_t len = strlen(blocks[seq]); // Length of the block name
|
||||
uint8_t _terminate = strlen(blocks[seq]); // Length of the block name
|
||||
if (_terminate > 49)
|
||||
_terminate = 49;
|
||||
block_name[_terminate] = 0;
|
||||
mavlink_msg_script_item_send(MAVLINK_COMM_0, mission_mgr.rem_sysid, mission_mgr.rem_compid,
|
||||
seq, len, block_name);
|
||||
seq, block_name);
|
||||
MAVLinkSendMessage();
|
||||
MAVLINK_DEBUG("Sent BLOCK_ITEM message: seq %i, name %s\n", seq, block_name);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user