aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-03-29 16:30:06 -0400
committerJames McCoy <jamessan@jamessan.com>2017-03-29 21:16:50 -0400
commit3116f870ba274862fa6d6643d9fa0870215fed12 (patch)
tree2a3852b64ff3e382a96220b13a1094950caabced
parent6964b67c00f9aa029791137f44f30ed4aef20ef4 (diff)
downloadrneovim-3116f870ba274862fa6d6643d9fa0870215fed12.tar.gz
rneovim-3116f870ba274862fa6d6643d9fa0870215fed12.tar.bz2
rneovim-3116f870ba274862fa6d6643d9fa0870215fed12.zip
coverity/161195: Increase scope of exe_name
Since exe_name is a stack allocated array, we need it to be in scope for the lifetime that vim_path points to it.
-rw-r--r--src/nvim/os/env.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index a73d753e46..a10c835591 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -615,9 +615,9 @@ char *vim_getenv(const char *name)
vim_path = (char *)p_hf;
}
+ char exe_name[MAXPATHL];
// Find runtime path relative to the nvim binary: ../share/nvim/runtime
if (vim_path == NULL) {
- char exe_name[MAXPATHL];
size_t exe_name_len = MAXPATHL;
if (os_exepath(exe_name, &exe_name_len) == 0) {
char *path_end = (char *)path_tail_with_sep((char_u *)exe_name);