aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIhor Antonov <ngortheone@users.noreply.github.com>2019-07-16 14:03:08 -0400
committerJustin M. Keyes <justinkz@gmail.com>2019-07-16 20:03:08 +0200
commitf31f2d0b225c5795eff29d4380dd66936fb6d96d (patch)
treea4d7241623641afb219973ad30ea45ce2999dffb
parent1eea2d236ff33245b426544ce4b90c8aafa53d90 (diff)
downloadrneovim-f31f2d0b225c5795eff29d4380dd66936fb6d96d.tar.gz
rneovim-f31f2d0b225c5795eff29d4380dd66936fb6d96d.tar.bz2
rneovim-f31f2d0b225c5795eff29d4380dd66936fb6d96d.zip
PVS/V1028: cast operands, not the result #10505
-rw-r--r--src/nvim/ops.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 7c38ecff4a..0f26d83597 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -2606,8 +2606,9 @@ static void op_yank_reg(oparg_T *oap, bool message, yankreg_T *reg, bool append)
static void yank_copy_line(yankreg_T *reg, struct block_def *bd, size_t y_idx)
{
- char_u *pnew = xmallocz((size_t)(bd->startspaces + bd->endspaces
- + bd->textlen));
+ int size = bd->startspaces + bd->endspaces + bd->textlen;
+ assert(size >= 0);
+ char_u *pnew = xmallocz((size_t)size);
reg->y_array[y_idx] = pnew;
memset(pnew, ' ', (size_t)bd->startspaces);
pnew += bd->startspaces;