Skip to content

Commit

Permalink
Style
Browse files Browse the repository at this point in the history
Signed-off-by: Yadunund <[email protected]>
  • Loading branch information
Yadunund committed Feb 19, 2024
1 parent cfe882c commit 8d8b3b3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rmw_zenoh_cpp/src/rmw_zenoh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1634,6 +1634,7 @@ rmw_take_sequence(
return RMW_RET_UNSUPPORTED;
}

//==============================================================================
static rmw_ret_t __rmw_take_serialized(
const rmw_subscription_t * subscription,
rmw_serialized_message_t * serialized_message,
Expand Down Expand Up @@ -1669,13 +1670,16 @@ static rmw_ret_t __rmw_take_serialized(
}

if (serialized_message->buffer_capacity < msg_data->payload.payload.len) {
rmw_ret_t ret = rmw_serialized_message_resize(serialized_message, msg_data->payload.payload.len);
rmw_ret_t ret =
rmw_serialized_message_resize(serialized_message, msg_data->payload.payload.len);
if (ret != RMW_RET_OK) {
return ret; // Error message already set
}
}
serialized_message->buffer_length = msg_data->payload.payload.len;
memcpy(serialized_message->buffer, msg_data->payload.payload.start, msg_data->payload.payload.len);
memcpy(
serialized_message->buffer, msg_data->payload.payload.start,
msg_data->payload.payload.len);

*taken = true;

Expand Down

0 comments on commit 8d8b3b3

Please sign in to comment.