]> git.tdb.fi Git - libs/core.git/commitdiff
Fix end-of-file detection in Slice
authorMikko Rasa <tdb@tdb.fi>
Mon, 7 Sep 2015 09:25:48 +0000 (12:25 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 7 Sep 2015 09:25:48 +0000 (12:25 +0300)
Prepare_op was incorrectly adding start_offset to the remaining length.

source/io/slice.cpp

index 59a7cde301b463d492fb79ef11733702d60d512e..63df62f29f841d164d5c52e7f80506c16a5a128f 100644 (file)
@@ -38,7 +38,7 @@ unsigned Slice::prepare_op(unsigned size, Mode m)
                sync_position = false;
        }
 
                sync_position = false;
        }
 
-       SeekOffset remaining = start_offset+length-position;
+       SeekOffset remaining = length-position;
        if(size>remaining)
                size = remaining;
        if(!size && m==M_READ)
        if(size>remaining)
                size = remaining;
        if(!size && m==M_READ)