aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarvin Borner2020-07-24 23:43:11 +0200
committerMarvin Borner2020-07-24 23:43:36 +0200
commit44861a9fd41de9b36c251df81535c9ed1cda416c (patch)
tree8bc513952e360fc96dc6d89484e457a651f3ff0b /src
parent1c00c0f2817f58b275a41d699e2eb32e8e9e5ed5 (diff)
I FINALLY FOUND THE BUG!
WHY?!
Diffstat (limited to 'src')
-rw-r--r--src/features/fs.c5
1 files changed, 2 insertions, 3 deletions
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;
}