aboutsummaryrefslogtreecommitdiff
path: root/kernel/features/fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/features/fs.c')
-rw-r--r--kernel/features/fs.c4
1 files changed, 2 insertions, 2 deletions
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); */
}