Skip to content

Commit

Permalink
Added check for $this->eof() to buffer read
Browse files Browse the repository at this point in the history
BufferStream::read() now checks $this->eof() and returns false if true.
implements #142 (one part of it)
  • Loading branch information
nozavroni committed Oct 6, 2016
1 parent 531e886 commit cd3c6a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/CSVelte/IO/BufferStream.php
Expand Up @@ -123,12 +123,12 @@ public function isReadable()
*/
public function read($chars)
{
if ($this->buffer === '') {
return false;
if (!$this->eof()) {
$data = substr($this->buffer, 0, $chars);
$this->buffer = substr($this->buffer, $chars);
return $data;
}
$data = substr($this->buffer, 0, $chars);
$this->buffer = substr($this->buffer, $chars);
return $data;
return false;
}

/**
Expand Down

0 comments on commit cd3c6a2

Please sign in to comment.