Skip to content

Commit

Permalink
Fix zid_to_str to treat z_id_t as little endian (#190)
Browse files Browse the repository at this point in the history
* Fix zid_to_str (a zid is little endian)

* Fix code style
  • Loading branch information
JEnoch authored Jun 3, 2024
1 parent 60b131e commit e686493
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rmw_zenoh_cpp/src/detail/liveliness_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,9 @@ std::string zid_to_str(const z_id_t & id)
{
std::stringstream ss;
ss << std::hex;
size_t i = 0;
for (; i < (sizeof(id.id)); i++) {
// By Zenoh convention a z_id_t is a little endian u128
size_t i = sizeof(id.id) - 1;
for (; i >= 0; i--) {
ss << static_cast<int>(id.id[i]);
}
return ss.str();
Expand Down

0 comments on commit e686493

Please sign in to comment.