summaryrefslogtreecommitdiffstats
path: root/screen-write.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-11-16 13:40:45 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-11-16 13:40:45 +0000
commit5d7bff40519f6e000cedfabce4ff0f5e6b8bcd98 (patch)
tree29a1a3e5fc83946d9311fcb9ccba24f36b0bab7a /screen-write.c
parent9f6d685c05c9f71ba842f65fb2139ebbd30bd606 (diff)
A screen can be one cell wide; don't crash if that is the case.
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/screen-write.c b/screen-write.c
index 49041377..81231c2e 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -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;