summaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2018-07-04 13:02:25 +0100
committerThomas Adam <thomas@xteddy.org>2018-07-04 13:02:25 +0100
commit850c26dd46a0b6983e32112fc1e37b8aa5a5268b (patch)
treece9250e828bfc4ab96e3faae08ea9695006a5721 /screen.c
parentdb07f338863eea6a8eda2b0efafb7e2b2500e14e (diff)
parent2fae6a57618e1cef47b65e73504d7d5570ca6a8e (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/screen.c b/screen.c
index 952392c2..5bde9e87 100644
--- a/screen.c
+++ b/screen.c
@@ -280,9 +280,8 @@ screen_resize_y(struct screen *s, u_int sy)
s->cy -= needed;
}
- /* Resize line arrays. */
- gd->linedata = xreallocarray(gd->linedata, gd->hsize + sy,
- sizeof *gd->linedata);
+ /* Resize line array. */
+ grid_adjust_lines(gd, gd->hsize + sy);
/* Size increasing. */
if (sy > oldy) {
@@ -305,7 +304,7 @@ screen_resize_y(struct screen *s, u_int sy)
/* Then fill the rest in with blanks. */
for (i = gd->hsize + sy - needed; i < gd->hsize + sy; i++)
- memset(&gd->linedata[i], 0, sizeof gd->linedata[i]);
+ memset(grid_get_line(gd, i), 0, sizeof(struct grid_line));
}
/* Set the new size, and reset the scroll region. */