Skip to content

Commit 030cddc

Browse files
committed
patch 7.4.2330
Problem: Coverity complains about not checking curwin to be NULL. Solution: Use firstwin to avoid the warning.
1 parent 26b8433 commit 030cddc

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/buffer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ buf_freeall(buf_T *buf, int flags)
707707
int is_curbuf = (buf == curbuf);
708708
bufref_T bufref;
709709
# ifdef FEAT_WINDOWS
710-
int is_curwin = (curwin!= NULL && curwin->w_buffer == buf);
710+
int is_curwin = (curwin != NULL && curwin->w_buffer == buf);
711711
win_T *the_curwin = curwin;
712712
tabpage_T *the_curtab = curtab;
713713
# endif
@@ -772,7 +772,7 @@ buf_freeall(buf_T *buf, int flags)
772772
#endif
773773
#ifdef FEAT_SYN_HL
774774
/* Remove any ownsyntax, unless exiting. */
775-
if (firstwin != NULL && curwin->w_buffer == buf)
775+
if (curwin != NULL && curwin->w_buffer == buf)
776776
reset_synblock(curwin);
777777
#endif
778778

@@ -788,7 +788,7 @@ buf_freeall(buf_T *buf, int flags)
788788
clearFolding(win);
789789
}
790790
# else
791-
if (curwin->w_buffer == buf)
791+
if (curwin != NULL && curwin->w_buffer == buf)
792792
clearFolding(curwin);
793793
# endif
794794
#endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,8 @@ static char *(features[]) =
763763

764764
static int included_patches[] =
765765
{ /* Add new patch number below this line */
766+
/**/
767+
2330,
766768
/**/
767769
2329,
768770
/**/

0 commit comments

Comments
 (0)