Skip to content

Commit

Permalink
AP_Camera: proper string formatting
Browse files Browse the repository at this point in the history
Incoming strings are 32 bytes and may not be null-terminated if the full width is used
  • Loading branch information
landswellsong authored and peterbarker committed Jul 17, 2024
1 parent c137586 commit 5190aee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/AP_Camera/AP_Camera_MAVLinkCamV2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void AP_Camera_MAVLinkCamV2::handle_message(mavlink_channel_t chan, const mavlin
const uint8_t fw_ver_build = (_cam_info.firmware_version & 0xFF000000) >> 24;

// display camera info to user
gcs().send_text(MAV_SEVERITY_INFO, "Camera: %s.32 %s.32 fw:%u.%u.%u.%u",
gcs().send_text(MAV_SEVERITY_INFO, "Camera: %.32s %.32s fw:%u.%u.%u.%u",
_cam_info.vendor_name,
_cam_info.model_name,
(unsigned)fw_ver_major,
Expand Down

0 comments on commit 5190aee

Please sign in to comment.