From 37532000a012530de4eb50142ff7c1cf7f5d52e8 Mon Sep 17 00:00:00 2001 From: pjht Date: Sun, 7 Apr 2019 14:12:45 -0500 Subject: [PATCH] Fix ext2 driver errors. --- fs/ext2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext2.c b/fs/ext2.c index 8caec4c..c3dc5a9 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -63,8 +63,8 @@ int read_char(inode inode,FILE* f,int pos,int num) { } } else if (block<268) { uint32_t* blocks=read_blk(inode.i_block[12],f,num); - if (blocks[i]==0) { - return -1 + if (blocks[block-12]==0) { + return -1; } else { return ((char*)read_blk(blocks[block],f,num))[pos]; }