From 84b8612987320f722c33dff3a3f16930407c62ce Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 23 Jul 2018 00:23:18 -0400 Subject: vim-patch:8.0.1512: warning for possibly using NULL pointer Problem: Warning for possibly using NULL pointer. (Coverity) Solution: Skip using the pointer if it's NULL. https://github.com/vim/vim/commit/e4db7aedab65abadcc84c78e7a10ec7bb62f11cf --- src/nvim/ex_cmds.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/nvim/ex_cmds.c') diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 3c6a8b1074..176df58fb9 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -4977,7 +4977,8 @@ void fix_help_buffer(void) while (*p != NUL) { copy_option_part(&p, NameBuff, MAXPATHL, ","); rt = (char_u *)vim_getenv("VIMRUNTIME"); - if (path_full_compare(rt, NameBuff, FALSE) != kEqualFiles) { + if (rt != NULL + && path_full_compare(rt, NameBuff, false) != kEqualFiles) { int fcount; char_u **fnames; FILE *fd; @@ -5197,8 +5198,9 @@ static void helptags_one(char_u *dir, char_u *ext, char_u *tagfname, * add the "help-tags" tag. */ ga_init(&ga, (int)sizeof(char_u *), 100); - if (add_help_tags || path_full_compare((char_u *)"$VIMRUNTIME/doc", - dir, FALSE) == kEqualFiles) { + if (add_help_tags + || path_full_compare((char_u *)"$VIMRUNTIME/doc", + dir, false) == kEqualFiles) { s = xmalloc(18 + STRLEN(tagfname)); sprintf((char *)s, "help-tags\t%s\t1\n", tagfname); GA_APPEND(char_u *, &ga, s); -- cgit