Skip to content

Commit

Permalink
Fix semantics per review comment
Browse files Browse the repository at this point in the history
Signed-off-by: Emerson Knapp <[email protected]>
  • Loading branch information
emersonknapp authored and eboasson committed Feb 11, 2020
1 parent 4209d76 commit cf8e4fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rmw_cyclonedds_cpp/src/serdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ void serdata_rmw::resize(size_t requested_size)

/* FIXME: CDR padding in DDSI makes me do this to avoid reading beyond the bounds
when copying data to network. Should fix Cyclone to handle that more elegantly. */
size_t n_pad_bytes = 4 - (requested_size % 4); // Same as (-x) % 4, without negating unsigned
size_t n_pad_bytes = (0 - requested_size) % 4;
m_data.reset(new byte[requested_size + n_pad_bytes]);
m_size = requested_size + n_pad_bytes;

Expand Down

0 comments on commit cf8e4fb

Please sign in to comment.