io/PeekReader: fix offset/size mixup

Regression by commit 7ccc4ddf0d
This commit is contained in:
Max Kellermann 2023-10-08 09:55:43 +02:00
parent 34182990ef
commit e521b58b01

View File

@ -17,7 +17,7 @@ PeekReader::Peek(size_t size)
assert(buffer_position == 0);
do {
size_t nbytes = next.Read(std::span{buffer}.first(buffer_size).subspan(size));
size_t nbytes = next.Read(std::span{buffer}.first(size).subspan(buffer_size));
if (nbytes == 0)
return nullptr;