termiointernals: no out-of-band read when selecting empty lines

This commit is contained in:
Boris Faure 2019-07-10 23:14:53 +02:00
parent dff54aeca2
commit 7f4d891610
1 changed files with 1 additions and 1 deletions

View File

@ -409,7 +409,7 @@ _sel_line(Termio *sd, int cy)
for (;;)
{
cells = termpty_cellrow_get(sd->pty, y - 1, &w);
if (!cells || !cells[w-1].att.autowrapped)
if (!cells || w <= 0 || !cells[w-1].att.autowrapped)
break;
y--;
}