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:
Jérôme Duval
2021-09-13 05:53:22 +00:00
parent 5b2fc19fa0
commit cc6736afae
@@ -242,7 +242,7 @@ StreamBuffer::Position()
{
off_t position = fStream->Position();
if (fToRead)
position -= fPos;
position -= (fLen - fPos);
else
position += fLen;
return position;