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

problem reported by eugene everson.
pull/1/head
Nicholas Marriott 2013-03-06 09:56:31 +00:00
parent 6405fceee2
commit ec75f9d1a3
1 changed files with 1 additions and 1 deletions

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