Mercurial > vim
changeset 10118:5d77565e6222 v7.4.2330
commit https://github.com/vim/vim/commit/030cddc7ec0c3d2fe3969140cd1b92b2f18633c0
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 4 23:41:42 2016 +0200
patch 7.4.2330
Problem: Coverity complains about not checking curwin to be NULL.
Solution: Use firstwin to avoid the warning.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 04 Sep 2016 23:45:05 +0200 |
parents | 0e4f59f9bbae |
children | ed2477b5d292 |
files | src/buffer.c src/version.c |
diffstat | 2 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/buffer.c +++ b/src/buffer.c @@ -707,7 +707,7 @@ buf_freeall(buf_T *buf, int flags) int is_curbuf = (buf == curbuf); bufref_T bufref; # ifdef FEAT_WINDOWS - int is_curwin = (curwin!= NULL && curwin->w_buffer == buf); + int is_curwin = (curwin != NULL && curwin->w_buffer == buf); win_T *the_curwin = curwin; tabpage_T *the_curtab = curtab; # endif @@ -772,7 +772,7 @@ buf_freeall(buf_T *buf, int flags) #endif #ifdef FEAT_SYN_HL /* Remove any ownsyntax, unless exiting. */ - if (firstwin != NULL && curwin->w_buffer == buf) + if (curwin != NULL && curwin->w_buffer == buf) reset_synblock(curwin); #endif @@ -788,7 +788,7 @@ buf_freeall(buf_T *buf, int flags) clearFolding(win); } # else - if (curwin->w_buffer == buf) + if (curwin != NULL && curwin->w_buffer == buf) clearFolding(curwin); # endif #endif