Skip to content

Commit 82aa706

Browse files
authored
Remove dst_size from strlen usage (ros2#353)
Signed-off-by: Jorge Perez <jjperez@ekumenlabs.com>
1 parent befc608 commit 82aa706

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/error_handling_helpers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ __rcutils_copy_string(char * dst, size_t dst_size, const char * src)
5454
assert(dst_size > 0);
5555
assert(src != NULL);
5656
// doesn't matter how long src actually is if it is longer than dst, so limit to dst + 1
57-
size_t src_length = strnlen(src, dst_size);
57+
size_t src_length = strlen(src);
5858
size_t size_to_copy = src_length;
5959
// the destination must be one byte bigger to store the NULL terminating character
6060
if (src_length >= dst_size) {

0 commit comments

Comments
 (0)