From 36cbc7f9586c22713017ff064990cb9001e8b9c8 Mon Sep 17 00:00:00 2001 From: Yadunund Date: Wed, 5 Jun 2024 01:44:27 +0800 Subject: [PATCH] Fix UB Signed-off-by: Yadunund --- rmw_zenoh_cpp/src/detail/liveliness_utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rmw_zenoh_cpp/src/detail/liveliness_utils.cpp b/rmw_zenoh_cpp/src/detail/liveliness_utils.cpp index c7d073e8..0b83a428 100644 --- a/rmw_zenoh_cpp/src/detail/liveliness_utils.cpp +++ b/rmw_zenoh_cpp/src/detail/liveliness_utils.cpp @@ -224,7 +224,7 @@ std::string zid_to_str(const z_id_t & id) std::stringstream ss; ss << std::hex; // By Zenoh convention a z_id_t is a little endian u128 - size_t i = sizeof(id.id) - 1; + int i = static_cast(sizeof(id.id) - 1); for (; i >= 0; i--) { ss << static_cast(id.id[i]); }