diff options
author | Ihor Antonov <ngortheone@users.noreply.github.com> | 2019-07-15 18:55:10 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-07-16 00:55:10 +0200 |
commit | de3e2f051e2a59d72498edc61db109a5f09708f0 (patch) | |
tree | 2187ffe92d9e474b622835fe78d6034a327341e3 | |
parent | 31f879983f5effb94a8d62c3073576511131bf6e (diff) | |
download | rneovim-de3e2f051e2a59d72498edc61db109a5f09708f0.tar.gz rneovim-de3e2f051e2a59d72498edc61db109a5f09708f0.tar.bz2 rneovim-de3e2f051e2a59d72498edc61db109a5f09708f0.zip |
PVS/V1028: cast operands, not the result #10498
The + 1 can be removed. It was used for current_screenline, which
now is dedicated linebuf_char buffer.
-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))); |