Skip to content

Commit

Permalink
compare string contents but string pointer addresses. (#153)
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 34314ee commit b93beec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion rosidl_typesupport_c/src/type_support_dispatch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ get_typesupport_handle_function(
return handle;
}

if (handle->typesupport_identifier == rosidl_typesupport_c__typesupport_identifier) {
if (strcmp(
handle->typesupport_identifier,
rosidl_typesupport_c__typesupport_identifier) == 0)
{
const type_support_map_t * map = \
static_cast<const type_support_map_t *>(handle->data);
for (size_t i = 0; i < map->size; ++i) {
Expand Down
5 changes: 4 additions & 1 deletion rosidl_typesupport_cpp/src/type_support_dispatch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ get_typesupport_handle_function(
return handle;
}

if (handle->typesupport_identifier == rosidl_typesupport_cpp::typesupport_identifier) {
if (strcmp(
handle->typesupport_identifier,
rosidl_typesupport_cpp::typesupport_identifier) == 0)
{
const type_support_map_t * map = \
static_cast<const type_support_map_t *>(handle->data);
for (size_t i = 0; i < map->size; ++i) {
Expand Down

0 comments on commit b93beec

Please sign in to comment.