Skip to content

Commit 73fe72c

Browse files
miguelafsilva5DavidMCerdeira
authored andcommitted
fix: Add a const qualifier to a cast from a const argument
The flag -Wcast-qual issues errors when a qualifier (e.g., const) is removed through a cast. Signed-off-by: Miguel Silva <[email protected]>
1 parent bd11359 commit 73fe72c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void* memcpy(void* dst, const void* src, size_t count)
1717
if (i + (WORD_SIZE - 1) > count - 1) {
1818
break;
1919
}
20-
*(unsigned long*)dst_tmp = *(unsigned long*)src_tmp;
20+
*(unsigned long*)dst_tmp = *(const unsigned long*)src_tmp;
2121
dst_tmp += WORD_SIZE;
2222
src_tmp += WORD_SIZE;
2323
}

0 commit comments

Comments
 (0)