Skip to content

Commit

Permalink
Fix rcutils_shared_library_t path on Windows. (ros2#322)
Browse files Browse the repository at this point in the history
GetModuleFileName() returns the size of the filename *minus* the null-terminating character.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
  • Loading branch information
hidmic authored Jan 7, 2021
1 parent 10dca5b commit c8373a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shared_library.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ rcutils_load_shared_library(
continue;
}
lib->library_path = lib->allocator.reallocate(
buffer, buffer_size, lib->allocator.state);
buffer, buffer_size + 1, lib->allocator.state);
if (NULL == lib->library_path) {
lib->library_path = buffer;
}
Expand Down

0 comments on commit c8373a9

Please sign in to comment.