From: John Hodge Date: Sun, 27 Sep 2009 08:46:05 +0000 (+0800) Subject: Debug X-Git-Tag: rel0.06~447 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=72b35e39ee35d38819ee847318cdde533d5b7fdc;p=tpg%2Facess2.git Debug --- diff --git a/Kernel/vfs/fs/fat.c b/Kernel/vfs/fs/fat.c index e03df096..533e9ccf 100644 --- a/Kernel/vfs/fs/fat.c +++ b/Kernel/vfs/fs/fat.c @@ -343,11 +343,14 @@ Uint64 FAT_Read(tVFS_Node *node, Uint64 offset, Uint64 length, void *buffer) } // Sanity Check offset - if(offset > node->Size){ + if(offset > node->Size) { + Log("FAT_Read: Reading past EOF (%i > %i)", offset, node->Size); return 0; } // Clamp Size - if(length + offset > node->Size) { + if(offset + length > node->Size) { + Log("FAT_Read: Reading past EOF (%i+%i+ > %i), clamped to %i", + offset, length, node->Size, offset - node->Size); length = offset - node->Size; } diff --git a/Usermode/Applications/cat_src/main.c b/Usermode/Applications/cat_src/main.c index c60ab27b..98776283 100644 --- a/Usermode/Applications/cat_src/main.c +++ b/Usermode/Applications/cat_src/main.c @@ -18,6 +18,7 @@ int main(int argc, char *argv[]) return -1; } + printf("Contents of `%s'\n", argv[1]); fd = open(argv[1], OPENFLAG_READ); if(fd == -1) { printf("Unable to open '%s' for reading\n", argv[1]);