Skip to content

Commit 287479c

Browse files
committed
fixup! Update src/string_array.c
Signed-off-by: Scott K Logan <logans@cottsay.net>
1 parent b808905 commit 287479c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/string_array.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ rcutils_string_array_resize(
162162
// rcutils_string_array_init should have already set an error message
163163
return ret;
164164
}
165-
memcpy(to_reclaim.data, &string_array->data[new_size], to_reclaim.size);
165+
memcpy(
166+
to_reclaim.data, &string_array->data[new_size],
167+
to_reclaim.size * sizeof(char *));
166168
}
167169

168170
char ** new_data = allocator->reallocate(

0 commit comments

Comments
 (0)