From c48406a5f87fd7ebe5a576fbf627b6c9efcc786e Mon Sep 17 00:00:00 2001 From: Tomoya Fujita Date: Thu, 29 Feb 2024 07:45:41 -0800 Subject: [PATCH] compare string contents but string pointer addresses. (#744) Signed-off-by: Tomoya Fujita --- rmw_fastrtps_dynamic_cpp/src/type_support_common.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rmw_fastrtps_dynamic_cpp/src/type_support_common.cpp b/rmw_fastrtps_dynamic_cpp/src/type_support_common.cpp index e139dcff6..e3cc7f459 100644 --- a/rmw_fastrtps_dynamic_cpp/src/type_support_common.cpp +++ b/rmw_fastrtps_dynamic_cpp/src/type_support_common.cpp @@ -25,12 +25,15 @@ 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; } 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; }