Skip to content

Commit

Permalink
perseus_sensors(m2m2_lidar): used strncmp to make intent clearer re R…
Browse files Browse the repository at this point in the history
…LE decode
  • Loading branch information
DingoOz committed Dec 22, 2024
1 parent 2d5490d commit 6206d49
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ std::vector<std::tuple<float, float, bool>> M2M2Lidar::_decodeLaserPoints(const
std::vector<uint8_t> decoded = _decodeBase64(base64_encoded);

if (decoded.size() < 9 ||
decoded[0] != 'R' ||
decoded[1] != 'L' ||
decoded[2] != 'E')
strncmp(reinterpret_cast<const char*>(decoded.data()), "RLE", 3) != 0)
{
RCLCPP_ERROR(this->get_logger(), "Invalid RLE header");
return points;
Expand Down

0 comments on commit 6206d49

Please sign in to comment.