mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
PVS/V108: cast operands, not the result #10501
This commit is contained in:

committed by
Justin M. Keyes

parent
b53b3f7dac
commit
56bc0a8bed
@@ -379,8 +379,10 @@ static void shift_block(oparg_T *oap, int amount)
|
|||||||
/* if we're splitting a TAB, allow for it */
|
/* if we're splitting a TAB, allow for it */
|
||||||
bd.textcol -= bd.pre_whitesp_c - (bd.startspaces != 0);
|
bd.textcol -= bd.pre_whitesp_c - (bd.startspaces != 0);
|
||||||
const int len = (int)STRLEN(bd.textstart) + 1;
|
const int len = (int)STRLEN(bd.textstart) + 1;
|
||||||
newp = (char_u *)xmalloc((size_t)(bd.textcol + i + j + len));
|
int col = bd.textcol + i +j + len;
|
||||||
memset(newp, NUL, (size_t)(bd.textcol + i + j + len));
|
assert(col >= 0);
|
||||||
|
newp = (char_u *)xmalloc((size_t)col);
|
||||||
|
memset(newp, NUL, (size_t)col);
|
||||||
memmove(newp, oldp, (size_t)bd.textcol);
|
memmove(newp, oldp, (size_t)bd.textcol);
|
||||||
memset(newp + bd.textcol, TAB, (size_t)i);
|
memset(newp + bd.textcol, TAB, (size_t)i);
|
||||||
memset(newp + bd.textcol + i, ' ', (size_t)j);
|
memset(newp + bd.textcol + i, ' ', (size_t)j);
|
||||||
|
Reference in New Issue
Block a user