Skip to content

Commit

Permalink
compare string contents but string pointer addresses. (#481)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomoya Fujita <[email protected]>
  • Loading branch information
fujitatomoya authored Feb 29, 2024
1 parent f3d802e commit d8973e8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rmw_cyclonedds_cpp/src/serdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,16 @@ using ResponseTypeSupport_cpp = rmw_cyclonedds_cpp::ResponseTypeSupport<

static bool using_introspection_c_typesupport(const char * typesupport_identifier)
{
return typesupport_identifier == rosidl_typesupport_introspection_c__identifier;
return strcmp(
typesupport_identifier,
rosidl_typesupport_introspection_c__identifier) == 0;
}

static bool using_introspection_cpp_typesupport(const char * typesupport_identifier)
{
return typesupport_identifier == rosidl_typesupport_introspection_cpp::typesupport_identifier;
return strcmp(
typesupport_identifier,
rosidl_typesupport_introspection_cpp::typesupport_identifier) == 0;
}

void * create_message_type_support(
Expand Down

0 comments on commit d8973e8

Please sign in to comment.