aboutsummaryrefslogtreecommitdiff
path: root/kernel/features
diff options
context:
space:
mode:
authorMarvin Borner2020-09-12 22:24:49 +0200
committerMarvin Borner2020-09-12 22:24:49 +0200
commit3d9a3328f4f055193c87e4c004edfbcfaec44be8 (patch)
tree548c54bb723fffbe961655f6d20b6819020353a1 /kernel/features
parent52ca9e4f610e65077cb2fab7c1ed0e802fa4ac59 (diff)
Some casual bug fixes
Diffstat (limited to 'kernel/features')
-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); */
}