From 44861a9fd41de9b36c251df81535c9ed1cda416c Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 24 Jul 2020 23:43:11 +0200 Subject: I FINALLY FOUND THE BUG! WHY?! --- src/features/fs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/features/fs.c b/src/features/fs.c index 123a178..65bbe8d 100644 --- a/src/features/fs.c +++ b/src/features/fs.c @@ -77,15 +77,14 @@ void *read_file(struct inode *in) if (i < 12) { blocknum = in->block[i]; data = buffer_read(blocknum); - memcpy((u32 *)buf + i * BLOCK_SIZE, data, BLOCK_SIZE); + memcpy((u32 *)((u32)buf + i * BLOCK_SIZE), data, BLOCK_SIZE); } else { blocknum = read_indirect(indirect, i - 13); data = buffer_read(blocknum); - memcpy((u32 *)buf + (i - 1) * BLOCK_SIZE, data, BLOCK_SIZE); + memcpy((u32 *)((u32)buf + (i - 1) * BLOCK_SIZE), data, BLOCK_SIZE); } } - // TODO: Fix space between 1024 and 4096 return buf; } -- cgit v1.2.3