Skip to content

Commit

Permalink
Fix timestamp codec len calculation (#1258)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets authored Jul 24, 2024
1 parent cb9fc8a commit f775853
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commons/zenoh-codec/src/core/timestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ use crate::{LCodec, RCodec, WCodec, Zenoh080};

impl LCodec<&Timestamp> for Zenoh080 {
fn w_len(self, x: &Timestamp) -> usize {
self.w_len(x.get_time().as_u64()) + self.w_len(x.get_id().size())
let id = x.get_id();
self.w_len(x.get_time().as_u64()) + self.w_len(&id.to_le_bytes()[..id.size()])
}
}

Expand Down

0 comments on commit f775853

Please sign in to comment.