Skip to content

Commit

Permalink
Fix feof check
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Jun 17, 2017
1 parent 0071609 commit 8b20bf9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ResourceInputStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct($stream, int $chunkSize = self::DEFAULT_CHUNK_SIZE)
// Error reporting suppressed since fread() produces a warning if the stream unexpectedly closes.
$data = @\fread($stream, $chunkSize);

if ($data === false || ($data === '' && (\feof($stream) || !\is_resource($stream)))) {
if ($data === false || ($data === '' && (!\is_resource($stream) || \feof($stream)))) {
$readable = false;
$resource = null;
Loop::cancel($watcher);
Expand Down

0 comments on commit 8b20bf9

Please sign in to comment.