summaryrefslogtreecommitdiffstats
path: root/grid.c
diff options
context:
space:
mode:
authornicm <nicm>2019-07-06 20:37:29 +0000
committernicm <nicm>2019-07-06 20:37:29 +0000
commit3635b3cd6c3343b2ec3f7173facef8a284e7e613 (patch)
tree773c43e81053193348309a242156d8e699a83aaf /grid.c
parent55c694a4679ee225b1962db63671422f3e641fc6 (diff)
Correctly clear underscore colour in grid_get_cell1, also fix struct
grid_cell to avoid padding. Fixes increased memory use reported by Suraj N Kurapati.
Diffstat (limited to 'grid.c')
-rw-r--r--grid.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/grid.c b/grid.c
index cddb5871..cbff99e2 100644
--- a/grid.c
+++ b/grid.c
@@ -37,12 +37,12 @@
/* Default grid cell data. */
const struct grid_cell grid_default_cell = {
- 0, 0, 8, 8, 0, { { ' ' }, 0, 1, 1 }
+ { { ' ' }, 0, 1, 1 }, 0, 0, 8, 8, 0
};
/* Cleared grid cell data. */
const struct grid_cell grid_cleared_cell = {
- GRID_FLAG_CLEARED, 0, 8, 8, 0, { { ' ' }, 0, 1, 1 }
+ { { ' ' }, 0, 1, 1 }, 0, GRID_FLAG_CLEARED, 8, 8, 0
};
static const struct grid_cell_entry grid_cleared_entry = {
GRID_FLAG_CLEARED, { .data = { 0, 8, 8, ' ' } }
@@ -475,6 +475,7 @@ grid_get_cell1(struct grid_line *gl, u_int px, struct grid_cell *gc)
gc->bg = gce->data.bg;
if (gce->flags & GRID_FLAG_BG256)
gc->bg |= COLOUR_FLAG_256;
+ gc->us = 0;
utf8_set(&gc->data, gce->data.data);
}