commit 8d54696d7ac94a26806f73387253441ba0789e03
parent adf31829198928d5fc8aa93a0d6356167b25ea36
Author: Matsuda Kenji <info@mtkn.jp>
Date: Sat, 27 Apr 2024 08:26:15 +0900
fix bug
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys/src/libc/endian.c b/sys/src/libc/endian.c
@@ -10,7 +10,7 @@ endian_little_to_native16(uint16 n)
uint16
endian_native_to_little16(uint16 n)
{
- uint8 m[4];
+ uint8 m[2];
m[0] = (uint8) n&0x000000ff;
m[1] = (uint8) ((n&0x0000ff00) >> 8);
return *(uint16 *)m;
@@ -46,7 +46,7 @@ endian_little_to_native64(uint64 n)
uint64
endian_native_to_little64(uint64 n)
{
- uint8 m[4];
+ uint8 m[8];
m[0] = (uint8) n&0x00000000000000ff;
m[1] = (uint8) ((n&0x000000000000ff00) >> 8);
m[2] = (uint8) ((n&0x0000000000ff0000) >> 16);