From 756f0d0fb874c08db5ada7bf3e554fa57a1dc5af Mon Sep 17 00:00:00 2001 From: Plankp Date: Wed, 18 Nov 2015 21:18:14 -0500 Subject: [PATCH] Close #38 --- kernel/kernel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/kernel.c b/kernel/kernel.c index cd16129..9be980d 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -35,14 +35,14 @@ int kmain(struct multiboot* mboot_ptr) return 0; } -#define RBUFF 256 void catFile(fs_node_t* fsnode) { printch('\n', 0x0F); if ((fsnode->flags & 0x7) == FS_FILE) { - char buf[RBUFF]; - uint32 sz = read_fs(fsnode, 0, RBUFF, (uint8*) buf); + const uint32 rbuff = fsnode->length; + char buf[rbuff]; + uint32 sz = read_fs(fsnode, 0, rbuff, (uint8*) buf); uint32 j; for (j = 0; j < sz; j++) printch(buf[j], 0x0F);