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);