Allow lastgc to be NULL in grid_string_cells so find-window doesn't crash,

problem reported by eugene everson.
This commit is contained in:
Nicholas Marriott 2013-03-06 09:56:31 +00:00
parent 6405fceee2
commit ec75f9d1a3

2
grid.c
View File

@ -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;
}