diff options
-rw-r--r-- | src/nvim/screen.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 63a465f332..553008c010 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -6079,8 +6079,8 @@ void grid_alloc(ScreenGrid *grid, int rows, int columns, bool copy, bool valid) { int new_row; ScreenGrid new = *grid; - - size_t ncells = (size_t)((rows+1) * columns); + assert(rows >= 0 && columns >= 0); + size_t ncells = (size_t)rows * columns; new.chars = xmalloc(ncells * sizeof(schar_T)); new.attrs = xmalloc(ncells * sizeof(sattr_T)); new.line_offset = xmalloc((size_t)(rows * sizeof(unsigned))); |