aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2013-03-06 09:56:31 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2013-03-06 09:56:31 +0000
commitec75f9d1a36b6f46e7ec6597d295f113c4aa12b3 (patch)
treeebd1b9f4a8b37c9d08ad9ece61aef32f1f3ef9af
parent6405fceee20c54aab10c1a3a2863861d1c0838b6 (diff)
downloadrtmux-ec75f9d1a36b6f46e7ec6597d295f113c4aa12b3.tar.gz
rtmux-ec75f9d1a36b6f46e7ec6597d295f113c4aa12b3.tar.bz2
rtmux-ec75f9d1a36b6f46e7ec6597d295f113c4aa12b3.zip
Allow lastgc to be NULL in grid_string_cells so find-window doesn't crash,
problem reported by eugene everson.
-rw-r--r--grid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/grid.c b/grid.c
index b30127f3..551a7dc9 100644
--- a/grid.c
+++ b/grid.c
@@ -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;
}