From b7f518cbfad2082e972b6e1bd0cac2b9e76f1b45 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 14 Feb 2019 05:49:35 +0100 Subject: PVS/V1028: cast operands, not the result --- src/nvim/garray.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit From 3d3a54f45551a9071c67adbea32dab5c7e70b88b Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 14 Feb 2019 05:54:42 +0100 Subject: clang/"null pointer dereference": win_rotate --- src/nvim/window.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/nvim/window.c b/src/nvim/window.c index e8b067d46c..24fe529fd6 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -1300,6 +1300,7 @@ static void win_rotate(int upwards, int count) if (upwards) { /* first window becomes last window */ /* remove first window/frame from the list */ frp = curwin->w_frame->fr_parent->fr_child; + assert(frp != NULL); wp1 = frp->fr_win; win_remove(wp1, NULL); frame_remove(frp); -- cgit