diff options
author | Ihor Antonov <ngortheone@users.noreply.github.com> | 2019-07-14 09:46:07 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-07-14 15:46:07 +0200 |
commit | 452112ae387ca73f8cec52ea0acca5e35b0a60e4 (patch) | |
tree | b6b7106c541d0fd088d796f819493a5d3c002c54 | |
parent | 1e47e3f599673f4eaec204ef6de8eb07edd182a7 (diff) | |
download | rneovim-452112ae387ca73f8cec52ea0acca5e35b0a60e4.tar.gz rneovim-452112ae387ca73f8cec52ea0acca5e35b0a60e4.tar.bz2 rneovim-452112ae387ca73f8cec52ea0acca5e35b0a60e4.zip |
PVS/V1028 ugrid.c:76 (#10495)
* code review
-rw-r--r-- | src/nvim/ugrid.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/ugrid.c b/src/nvim/ugrid.c index 8adb421ee1..9e4aaff878 100644 --- a/src/nvim/ugrid.c +++ b/src/nvim/ugrid.c @@ -6,6 +6,7 @@ #include <stdio.h> #include <limits.h> +#include "nvim/assert.h" #include "nvim/vim.h" #include "nvim/ui.h" #include "nvim/ugrid.h" @@ -72,8 +73,9 @@ void ugrid_scroll(UGrid *grid, int top, int bot, int left, int right, int count) for (i = start; i != stop; i += step) { UCell *target_row = grid->cells[i] + left; UCell *source_row = grid->cells[i + count] + left; + assert(right >= left && left >= 0); memcpy(target_row, source_row, - sizeof(UCell) * (size_t)(right - left + 1)); + sizeof(UCell) * ((size_t)right - (size_t)left + 1)); } } |