aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-10-21 20:11:13 +0200
committerJustin M. Keyes <justinkz@gmail.com>2018-10-21 23:24:21 +0200
commit863dbbb3d4a6d248ccd33092c17dcded2f194006 (patch)
tree6bf9665d213f89313e80d49f183ab93f44feb2b8
parent25bc65698860b8713ef83e32015c0fd43247ebb4 (diff)
downloadrneovim-863dbbb3d4a6d248ccd33092c17dcded2f194006.tar.gz
rneovim-863dbbb3d4a6d248ccd33092c17dcded2f194006.tar.bz2
rneovim-863dbbb3d4a6d248ccd33092c17dcded2f194006.zip
fix warning: "Uninitialized argument"
clang scan-build thinks os_system() could set `do_profiling` flag. Found by clang scan-build 5.0
-rw-r--r--src/nvim/eval.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 515dd0e69f..052e0e3f35 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -16461,6 +16461,7 @@ static void get_system_output_as_rettv(typval_T *argvars, typval_T *rettv,
bool retlist)
{
proftime_T wait_time;
+ bool profiling = do_profiling == PROF_YES;
rettv->v_type = VAR_STRING;
rettv->vval.v_string = NULL;
@@ -16497,7 +16498,7 @@ static void get_system_output_as_rettv(typval_T *argvars, typval_T *rettv,
xfree(cmdstr);
}
- if (do_profiling == PROF_YES) {
+ if (profiling) {
prof_child_enter(&wait_time);
}
@@ -16506,7 +16507,7 @@ static void get_system_output_as_rettv(typval_T *argvars, typval_T *rettv,
char *res = NULL;
int status = os_system(argv, input, input_len, &res, &nread);
- if (do_profiling == PROF_YES) {
+ if (profiling) {
prof_child_exit(&wait_time);
}