PVS/V1028 ugrid.c:76 (#10495)

* code review
This commit is contained in:
Ihor Antonov 2019-07-14 09:46:07 -04:00 committed by Justin M. Keyes
parent 1e47e3f599
commit 452112ae38

View File

@ -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));
}
}