summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-11-16 13:40:46 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-11-16 13:40:46 +0000
commitc0d41b73add87e87f77d4931fa0581dfefed31f0 (patch)
tree47aeb2d0044ef39d122389750225c4ca99ba470a /usr.bin
parent9d50e7424d7e4809ba1197ae276bf68899e78df9 (diff)
A screen can be one cell wide; don't crash if that is the case.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/screen-write.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c
index cf60ea92f45..13ab91d42e6 100644
--- a/usr.bin/tmux/screen-write.c
+++ b/usr.bin/tmux/screen-write.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen-write.c,v 1.37 2009/11/11 18:53:21 nicm Exp $ */
+/* $OpenBSD: screen-write.c,v 1.38 2009/11/16 13:40:45 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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;