From 67cb7f877ae5baa44daf956a801f9bade02e0335 Mon Sep 17 00:00:00 2001 From: suter Date: Fri, 11 Apr 2014 10:10:08 +0200 Subject: [PATCH 1/1] make read really depend on current position in the file --- src/surf/storage_n11.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index d27457bca7..3b191c8b73 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -458,12 +458,12 @@ StorageActionPtr StorageN11::close(surf_file_t fd) StorageActionPtr StorageN11::read(surf_file_t fd, sg_size_t size) { - if(size > fd->size){ - size = fd->size; + if(fd->current_position + size > fd->size){ + size = fd->size - fd->current_position; fd->current_position = fd->size; } else - fd->current_position += size; + fd->current_position += size; StorageActionPtr action = new StorageN11Action(getModel(), size, getState() != SURF_RESOURCE_ON, this, READ); return action; -- 2.20.1