Skip to content

Commit

Permalink
Address peer review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
  • Loading branch information
ivanpauno committed Feb 28, 2020
1 parent 533ea2b commit a905ae9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions rcl/include/rcl/security.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ extern "C"
# define ROS_SECURITY_ENABLE_VAR_NAME "ROS_SECURITY_ENABLE"
#endif

/// Init the security options from the values of the environment variables and passed names.
/// Initialize security options from values in the environment variables and given names.
/**
* Inits the passed security options based on the environment.
* Initialize the given security options based on the environment.
* For more details:
* \sa rcl_security_enabled
* \sa rcl_get_enforcement_policy
Expand Down
4 changes: 2 additions & 2 deletions rcl/src/rcl/domain_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const char * const RCL_DOMAIN_ID_ENV_VAR = "ROS_DOMAIN_ID";
rcl_ret_t
rcl_get_default_domain_id(size_t * domain_id)
{
const char * ros_domain_id;
const char * get_env_error_str;
const char * ros_domain_id = NULL;
const char * get_env_error_str = NULL;

if (!domain_id) {
return RCL_RET_INVALID_ARGUMENT;
Expand Down
1 change: 1 addition & 0 deletions rcl/src/rcl/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ rcl_init(
}

TRACEPOINT(rcl_init, (const void *)context);

return RCL_RET_OK;
fail:
__cleanup_context(context);
Expand Down
8 changes: 4 additions & 4 deletions rcl/src/rcl/security.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ rcl_get_security_options_from_environment(
return ret;
}

RCUTILS_LOG_DEBUG_NAMED(
ROS_PACKAGE_NAME, "Using security: %s", use_security ? "true" : "false");

if (!use_security) {
security_options->enforce_security = RMW_SECURITY_ENFORCEMENT_PERMISSIVE;
return RMW_RET_OK;
}

RCUTILS_LOG_DEBUG_NAMED(
ROS_PACKAGE_NAME, "Using security: %s", use_security ? "true" : "false");

ret = rcl_get_enforcement_policy(&security_options->enforce_security);
if (RCL_RET_OK != ret) {
return ret;
Expand Down Expand Up @@ -201,7 +201,7 @@ static bool get_best_matching_directory(
matched_name_length > max_match_length)
{
max_match_length = matched_name_length;
memcpy(matched_name, file.name, max_match_length);
strncpy(matched_name, file.name, max_match_length + 1);
}
}
if (-1 == tinydir_next(&dir)) {
Expand Down

0 comments on commit a905ae9

Please sign in to comment.