Commit: daab2c43819c32a757f52c7763efc00d4d09879b
Parent: 9d1a75a7f5777ef3edbc96109306633d918145d7
Author: Randy Palamar
Date: Tue, 31 Dec 2024 16:50:35 -0700
platform_linux.c: fix DIRENT_NAME macro
Since the member is a c string we need to be a little careful
about accessing it
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/platform_linux.c b/platform_linux.c
@@ -24,7 +24,7 @@ typedef __attribute__((aligned(16))) u8 stat_buffer[144];
#define DIRENT_BUF_MEMBER(db, t, off) (*(t *)((u8 *)(db) + off))
#define DIRENT_RECLEN(db) DIRENT_BUF_MEMBER(db, u16, 16)
#define DIRENT_TYPE(db) DIRENT_BUF_MEMBER(db, u8, 18)
-#define DIRENT_NAME(db) DIRENT_BUF_MEMBER(db, char *, 19)
+#define DIRENT_NAME(db) (char *)((db) + 19)
static i64 syscall1(i64, i64);
static i64 syscall2(i64, i64, i64);