From b7f518cbfad2082e972b6e1bd0cac2b9e76f1b45 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 14 Feb 2019 05:49:35 +0100 Subject: [PATCH] PVS/V1028: cast operands, not the result --- src/nvim/garray.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvim/garray.c b/src/nvim/garray.c index 2d2af54c95..74fd9d89cb 100644 --- a/src/nvim/garray.c +++ b/src/nvim/garray.c @@ -91,8 +91,8 @@ void ga_grow(garray_T *gap, int n) } int new_maxlen = gap->ga_len + n; - size_t new_size = (size_t)(gap->ga_itemsize * new_maxlen); - size_t old_size = (size_t)(gap->ga_itemsize * gap->ga_maxlen); + size_t new_size = (size_t)gap->ga_itemsize * (size_t)new_maxlen; + size_t old_size = (size_t)gap->ga_itemsize * (size_t)gap->ga_maxlen; // reallocate and clear the new memory char *pp = xrealloc(gap->ga_data, new_size);