1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-05 12:56:08 +00:00

Update size in vt_grow if we don't have to reallocate

vt_grow may be called with a new size that's larger than previous but
does not require reallocation - for example, when the number of columns
is the same and new number of rows is less than the history size.
Prior to this change we would fail to update vb_scr_size, and then hit
a KASSERT when trying to write to the newly visible rows.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Ed Maste 2014-05-29 21:10:33 +00:00
parent 2f308a343f
commit 7cd5ec40cf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=266861

View File

@ -496,6 +496,9 @@ vtbuf_grow(struct vt_buf *vb, const term_pos_t *p, int history_size)
/* Deallocate old buffer. */
free(old, M_VTBUF);
free(oldrows, M_VTBUF);
} else {
/* Just update the size. */
vb->vb_scr_size = *p;
}
}