diff options
-rw-r--r-- | lib/App/Termcast.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/App/Termcast.pm b/lib/App/Termcast.pm index a100e25..0f2dc7e 100644 --- a/lib/App/Termcast.pm +++ b/lib/App/Termcast.pm @@ -71,7 +71,7 @@ sub run { if (vec($rout, fileno(STDIN), 1)) { my $buf; sysread STDIN, $buf, 4096; - if (!$buf) { + if (!defined $buf || length $buf == 0) { warn "Error reading from stdin: $!" unless defined $buf; last; } @@ -79,7 +79,7 @@ sub run { } if (vec($rout, $ptyfd, 1)) { my $buf = $pty->read(0); - if (!$buf) { + if (!defined $buf || length $buf == 0) { warn "Error reading from pty: $!" unless defined $buf; last; } |