$line = <$rfh>;
$line =~ s/\r//og;
}
+ if (length $line == 0) {
+ dbg('connect', "received 0 length line, aborting...");
+ cease(11);
+ }
dbg('connect', "received \"$line\"");
if ($abort && $line =~ /$abort/i) {
dbg('connect', "aborted on /$abort/");
# display the top screen
sub show_screen
{
- if ($spos == @shistory - 1) {
+ if ($spos >= @shistory - 1) {
# if we really are scrolling thru at the end of the history
my $line = $shistory[$spos];