aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}