Fix semantics per review comment

Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
This commit is contained in:
Emerson Knapp 2020-02-10 11:00:31 -08:00 committed by eboasson
parent 4209d7654b
commit cf8e4fb91e

View file

@ -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 /* 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. */ 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_data.reset(new byte[requested_size + n_pad_bytes]);
m_size = requested_size + n_pad_bytes; m_size = requested_size + n_pad_bytes;