From: Mikko Rasa Date: Mon, 7 Sep 2015 09:25:48 +0000 (+0300) Subject: Fix end-of-file detection in Slice X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=970a9aee41d1e0b7aecdd972583e7396433a739f;p=libs%2Fcore.git Fix end-of-file detection in Slice Prepare_op was incorrectly adding start_offset to the remaining length. --- diff --git a/source/io/slice.cpp b/source/io/slice.cpp index 59a7cde..63df62f 100644 --- a/source/io/slice.cpp +++ b/source/io/slice.cpp @@ -38,7 +38,7 @@ unsigned Slice::prepare_op(unsigned size, Mode m) sync_position = false; } - SeekOffset remaining = start_offset+length-position; + SeekOffset remaining = length-position; if(size>remaining) size = remaining; if(!size && m==M_READ)