From 63ef2e9e54437a315bffc5b23ca666a199917bb0 Mon Sep 17 00:00:00 2001 From: Maihuanyi Date: Thu, 26 Feb 2026 08:44:52 +0800 Subject: [PATCH] [src][klibc]: Fixing hardware errors triggered by byte-aligned access in the rt_memset function; --- src/klibc/kstring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/klibc/kstring.c b/src/klibc/kstring.c index b6d553ffa34..52d2f93795a 100644 --- a/src/klibc/kstring.c +++ b/src/klibc/kstring.c @@ -72,7 +72,7 @@ void *rt_memset(void *s, int c, size_t count) */ for (i = 0; i < LBLOCKSIZE; i++) { - *(((unsigned char *)&buffer)+i) = d; + buffer = (buffer << 8) | (char) d; } while (count >= LBLOCKSIZE * 4)