From 3d9a3328f4f055193c87e4c004edfbcfaec44be8 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 12 Sep 2020 22:24:49 +0200 Subject: Some casual bug fixes --- kernel/features/fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kernel') diff --git a/kernel/features/fs.c b/kernel/features/fs.c index a0c8735..2db0a97 100644 --- a/kernel/features/fs.c +++ b/kernel/features/fs.c @@ -83,13 +83,13 @@ void *read_inode(struct inode *in) indirect = in->block[12]; blocknum = read_indirect(indirect, i - 12); data = buffer_read(blocknum); - memcpy((u32 *)((u32)buf + (i - 1) * BLOCK_SIZE), data, BLOCK_SIZE); + memcpy((u32 *)((u32)buf + i * BLOCK_SIZE), data, BLOCK_SIZE); } else { indirect = in->block[13]; blocknum = read_indirect(indirect, (i - (BLOCK_COUNT + 12)) / BLOCK_COUNT); blocknum = read_indirect(blocknum, (i - (BLOCK_COUNT + 12)) % BLOCK_COUNT); data = buffer_read(blocknum); - memcpy((u32 *)((u32)buf + (i - 1) * BLOCK_SIZE), data, BLOCK_SIZE); + memcpy((u32 *)((u32)buf + i * BLOCK_SIZE), data, BLOCK_SIZE); } /* printf("Loaded %d of %d\n", i + 1, num_blocks); */ } -- cgit v1.2.3