diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-03-25 10:07:41 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-03-25 10:07:41 +0000 |
commit | fefe4f7b4ec439afa7d3637dc9967f7788433dd1 (patch) | |
tree | 60cf26fbe7cb1ede3db0c403a75f8557465d2ea6 /usr.bin/tmux | |
parent | d93299c737ff4e5045b491bf4173316bfde8634a (diff) |
Allow lastgc to be NULL in grid_string_cells so find-window doesn't
crash, problem reported by eugene everson.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/grid.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/grid.c b/usr.bin/tmux/grid.c index 369beff2646..70ff4b005b3 100644 --- a/usr.bin/tmux/grid.c +++ b/usr.bin/tmux/grid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grid.c,v 1.28 2013/03/25 10:05:35 nicm Exp $ */ +/* $OpenBSD: grid.c,v 1.29 2013/03/25 10:07:40 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -595,7 +595,7 @@ grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx, GRID_DEBUG(gd, "px=%u, py=%u, nx=%u", px, py, nx); - if (*lastgc == NULL) { + if (lastgc != NULL && *lastgc == NULL) { memcpy(&lastgc1, &grid_default_cell, sizeof lastgc1); *lastgc = &lastgc1; } |