Fix incorrect read from StringBuffer with starting offset > 0

This commit is contained in:
Daniel Nachtrub 2021-04-18 19:59:59 +02:00
commit 08c0fefe25

View file

@ -44,7 +44,7 @@ class StringBuffer {
} }
public function read(int $count): string { public function read(int $count): string {
$chunk = substr($this->buffer, $this->pos, $this->pos + $count); $chunk = substr($this->buffer, $this->pos, $count);
$this->pos += strlen($chunk); $this->pos += strlen($chunk);
return $chunk; return $chunk;
} }