aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-01-13 23:09:59 +0100
committerGitHub <noreply@github.com>2019-01-13 23:09:59 +0100
commita3d8cd3f69807d70d00eb58d4a654dde8ecda0e3 (patch)
treebbd5c9b9c1e873099cd8f222707d680fd850721a /src/nvim/buffer.c
parent61ec31cde1373033179985f737b55e05cc1a2df7 (diff)
parent4cba75dab08ce718ff3e7500ca943789c1099c4e (diff)
downloadrneovim-a3d8cd3f69807d70d00eb58d4a654dde8ecda0e3.tar.gz
rneovim-a3d8cd3f69807d70d00eb58d4a654dde8ecda0e3.tar.bz2
rneovim-a3d8cd3f69807d70d00eb58d4a654dde8ecda0e3.zip
Merge #9471 from justinmk/pvs-warnings
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 22c8a2bf05..c15a6f1330 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -447,7 +447,8 @@ void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last)
return;
}
- if (win_valid_any_tab(win)) {
+ if (win != NULL // Avoid bogus clang warning.
+ && win_valid_any_tab(win)) {
// Set b_last_cursor when closing the last window for the buffer.
// Remember the last cursor position and window options of the buffer.
// This used to be only for the current window, but then options like
@@ -575,7 +576,9 @@ void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last)
if (buf == curbuf && !is_curbuf)
return;
- if (win_valid_any_tab(win) && win->w_buffer == buf) {
+ if (win != NULL // Avoid bogus clang warning.
+ && win_valid_any_tab(win)
+ && win->w_buffer == buf) {
win->w_buffer = NULL; // make sure we don't use the buffer now
}