A screen can be one cell wide; don't crash if that is the case.

This commit is contained in:
Nicholas Marriott 2009-11-16 13:40:45 +00:00
parent 9f6d685c05
commit 5d7bff4051

View File

@ -427,8 +427,8 @@ screen_write_initctx(
return;
/* Save the last cell on the screen. */
gc = NULL;
for (xx = 1; xx < screen_size_x(s); xx++) {
gc = &grid_default_cell;
for (xx = 1; xx <= screen_size_x(s); xx++) {
gc = grid_view_peek_cell(gd, screen_size_x(s) - xx, s->cy);
if (!(gc->flags & GRID_FLAG_PADDING))
break;