StreamBuffer: fix Position() for read streams
the file position corresponds to the end of the buffer. Change-Id: Ib67dcfe1f43d959777c2f6dbf84181f25a022a7c Reviewed-on: https://review.haiku-os.org/c/haiku/+/4447 Tested-by: Commit checker robot <[email protected]> Reviewed-by: Jérôme Duval <[email protected]>
This commit is contained in:
@@ -242,7 +242,7 @@ StreamBuffer::Position()
|
|||||||
{
|
{
|
||||||
off_t position = fStream->Position();
|
off_t position = fStream->Position();
|
||||||
if (fToRead)
|
if (fToRead)
|
||||||
position -= fPos;
|
position -= (fLen - fPos);
|
||||||
else
|
else
|
||||||
position += fLen;
|
position += fLen;
|
||||||
return position;
|
return position;
|
||||||
|
|||||||
Reference in New Issue
Block a user