Skip to content

Commit 63ef2e9

Browse files
committed
[src][klibc]: Fixing hardware errors triggered by byte-aligned access in the rt_memset function;
1 parent f610f18 commit 63ef2e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/klibc/kstring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void *rt_memset(void *s, int c, size_t count)
7272
*/
7373
for (i = 0; i < LBLOCKSIZE; i++)
7474
{
75-
*(((unsigned char *)&buffer)+i) = d;
75+
buffer = (buffer << 8) | (char) d;
7676
}
7777

7878
while (count >= LBLOCKSIZE * 4)

0 commit comments

Comments
 (0)