From 84aa457ccdf88baeee1e87ba763fafe0ff77095e Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:02:43 +0300 Subject: os/env: Fix “invalid pointer to local” false positive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nvim/os/env.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/os/env.c') diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index ad51e598c1..f3187de182 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -641,7 +641,7 @@ char *vim_getenv(const char *name) exe_name, "share" _PATHSEPSTR "nvim" _PATHSEPSTR "runtime" _PATHSEPSTR, MAXPATHL) == OK) { - vim_path = exe_name; + vim_path = exe_name; // -V507 } } } @@ -675,6 +675,7 @@ char *vim_getenv(const char *name) vim_path = NULL; } } + assert(vim_path != exe_name); } #ifdef HAVE_PATHDEF -- cgit From c2f3e361c52ec4e7149ea1d8c6a1202e0873da8e Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 19 Apr 2017 19:11:50 +0300 Subject: *: Add comment to all C files --- src/nvim/os/env.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nvim/os/env.c') diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index f3187de182..72bd0bf788 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // Environment inspection #include -- cgit