From 25d4218362c50ce117e8f57e28a445eb5f98c22b Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 16 Apr 2003 19:35:02 +0000 Subject: 2002-04-10 Victor V. Vengerov PR 385/filesystem * src/ramdisk.c: The "from" and "to" locations are calculated as the start of the block within the ram that data is to be transferred from/to for reads and writes respectively. However, within the loops, the "from" and "to" locations are never updated. The loop should have been updated as: from += rd->block_size; and to += rd->block_size; within the for loops in the ramdisk_read and ramdisk_write routines, respectively. --- cpukit/libblock/src/ramdisk.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cpukit/libblock/src/ramdisk.c') diff --git a/cpukit/libblock/src/ramdisk.c b/cpukit/libblock/src/ramdisk.c index 7be2eabcc8..99d90bd1e5 100644 --- a/cpukit/libblock/src/ramdisk.c +++ b/cpukit/libblock/src/ramdisk.c @@ -61,6 +61,7 @@ ramdisk_read(struct ramdisk *rd, blkdev_request *req) count = remains; memcpy(sg->buffer, from, count); remains -= count; + from += count; } req->req_done(req->done_arg, RTEMS_SUCCESSFUL, 0); return 0; @@ -95,6 +96,7 @@ ramdisk_write(struct ramdisk *rd, blkdev_request *req) count = remains; memcpy(to, sg->buffer, count); remains -= count; + to += count; } req->req_done(req->done_arg, RTEMS_SUCCESSFUL, 0); return 0; -- cgit v1.2.3