X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d213730ffa04b59ccd00c369ab2e66228e3f676f..db47f7bec9a8c821125bda2d6cb27626e12e7fa7:/src/surf/storage_n11.cpp diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index 8fc1edec8b..42fef37138 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -433,7 +433,11 @@ StorageAction *StorageN11::close(surf_file_t fd) StorageAction *StorageN11::read(surf_file_t fd, sg_size_t size) { if(fd->current_position + size > fd->size){ - size = fd->size - fd->current_position; + if (fd->current_position > fd->size){ + size = 0; + } else { + size = fd->size - fd->current_position; + } fd->current_position = fd->size; } else