Skip to content

Commit

Permalink
Remove dst_size from strlen usage
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Perez <jjperez@ekumenlabs.com>
  • Loading branch information
Blast545 committed Feb 24, 2022
1 parent befc608 commit 99a038e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/error_handling_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ __rcutils_copy_string(char * dst, size_t dst_size, const char * src)
assert(dst_size > 0);
assert(src != NULL);
// doesn't matter how long src actually is if it is longer than dst, so limit to dst + 1
size_t src_length = strnlen(src, dst_size);
size_t src_length = strlen(src);
size_t size_to_copy = src_length;
// the destination must be one byte bigger to store the NULL terminating character
if (src_length >= dst_size) {
Expand Down

0 comments on commit 99a038e

Please sign in to comment.