Skip to content

Commit

Permalink
Fix remapping (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogs9 authored Jul 1, 2020
1 parent d651b11 commit 3216959
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rcl/src/rcl/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ rcl_client_init(
remapped_service_name = expanded_service_name;
expanded_service_name = NULL;
}
#else
remapped_service_name = (char *)allocator->allocate(strlen(expanded_service_name) + 1, allocator->state);
memcpy(remapped_service_name, expanded_service_name, strlen(expanded_service_name) + 1);
#endif // RCL_COMMAND_LINE_ENABLED

// Validate the expanded service name.
Expand Down
3 changes: 3 additions & 0 deletions rcl/src/rcl/publisher.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ rcl_publisher_init(
remapped_topic_name = expanded_topic_name;
expanded_topic_name = NULL;
}
#else
remapped_topic_name = (char *)allocator->allocate(strlen(expanded_topic_name) + 1, allocator->state);
memcpy(remapped_topic_name, expanded_topic_name, strlen(expanded_topic_name) + 1);
#endif // RCL_COMMAND_LINE_ENABLED

// Validate the expanded topic name.
Expand Down
3 changes: 3 additions & 0 deletions rcl/src/rcl/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ rcl_service_init(
remapped_service_name = expanded_service_name;
expanded_service_name = NULL;
}
#else
remapped_service_name = (char *)allocator->allocate(strlen(expanded_service_name) + 1, allocator->state);
memcpy(remapped_service_name, expanded_service_name, strlen(expanded_service_name) + 1);
#endif // RCL_COMMAND_LINE_ENABLED

// Validate the expanded service name.
Expand Down
3 changes: 3 additions & 0 deletions rcl/src/rcl/subscription.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ rcl_subscription_init(
remapped_topic_name = expanded_topic_name;
expanded_topic_name = NULL;
}
#else
remapped_topic_name = (char *)allocator->allocate(strlen(expanded_topic_name) + 1, allocator->state);
memcpy(remapped_topic_name, expanded_topic_name, strlen(expanded_topic_name) + 1);
#endif // RCL_COMMAND_LINE_ENABLED

// Validate the expanded topic name.
Expand Down

0 comments on commit 3216959

Please sign in to comment.