Skip to content

Commit 193d319

Browse files
authored
Fix gcc 15.2.1 warning for discarding 'const' qualifier (ros2#547)
Signed-off-by: Eddy Gharib <eddy.gharib@idealworks.com>
1 parent a663ed7 commit 193d319

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/strdup.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ rcutils_strndup(const char * str, size_t max_length, rcutils_allocator_t allocat
4444
return NULL;
4545
}
4646
RCUTILS_CHECK_ALLOCATOR(&allocator, return NULL);
47-
char * p = memchr(str, '\0', max_length);
47+
const char * p = memchr(str, '\0', max_length);
4848
size_t string_length = p == NULL ? max_length : (size_t)(p - str);
4949
char * new_string = allocator.allocate(string_length + 1, allocator.state);
5050
if (NULL == new_string) {

0 commit comments

Comments
 (0)