parent
f7d7df6d69
commit
ffcfc34890
1 changed files with 1 additions and 2 deletions
|
@ -147,12 +147,11 @@ rcl_node_init(
|
||||||
local_namespace_ = "/";
|
local_namespace_ = "/";
|
||||||
}
|
}
|
||||||
|
|
||||||
char * temp = NULL;
|
|
||||||
// If the namespace does not start with a /, add one.
|
// If the namespace does not start with a /, add one.
|
||||||
if (namespace_length > 0 && namespace_[0] != '/') {
|
if (namespace_length > 0 && namespace_[0] != '/') {
|
||||||
// TODO(wjwwood): replace with generic strcat that takes an allocator once available
|
// TODO(wjwwood): replace with generic strcat that takes an allocator once available
|
||||||
// length + 2, because new leading / and terminating \0
|
// length + 2, because new leading / and terminating \0
|
||||||
temp = (char *)allocator->allocate(namespace_length + 2, allocator->state);
|
char * temp = (char *)allocator->allocate(namespace_length + 2, allocator->state);
|
||||||
RCL_CHECK_FOR_NULL_WITH_MSG(
|
RCL_CHECK_FOR_NULL_WITH_MSG(
|
||||||
temp, "allocating memory failed", return RCL_RET_BAD_ALLOC, *allocator);
|
temp, "allocating memory failed", return RCL_RET_BAD_ALLOC, *allocator);
|
||||||
temp[0] = '/';
|
temp[0] = '/';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue