From 94c04a035b30f1e0080b86545f918cdc8311b1d8 Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Sun, 14 Aug 2016 11:32:47 +0200 Subject: [PATCH] Fix ramdisk read --- kernel/src/ramdisk.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/src/ramdisk.cpp b/kernel/src/ramdisk.cpp index bf30875e..9ca7fdbb 100644 --- a/kernel/src/ramdisk.cpp +++ b/kernel/src/ramdisk.cpp @@ -59,9 +59,9 @@ size_t ramdisk::ramdisk_driver::read(void* data, char* destination, size_t count // If the page is not allocated, we simply consider it full of zero if(!disk->allocated[page]){ - std::fill_n(destination, to_read, 0); + std::fill_n(destination + read, to_read, 0); } else { - std::copy_n(destination, disk->allocated[page] + page_offset, to_read); + std::copy_n(destination + read, disk->allocated[page] + page_offset, to_read); } read += to_read;