Merge pull request #105 from danielnachtrub/bugfix/StringBufferRead

Fix incorrect read from StringBuffer with starting offset > 0
This commit is contained in:
Robin Appelman 2021-04-19 13:36:20 +00:00 committed by GitHub
commit 6776467542
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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;
} }