From 729f270266dac57a9b214dc69a9a2249fe1a1ce6 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 5 Jun 2021 10:18:15 -0400 Subject: userfunc: pvs/v547 vim_strsave() returns nonnull. --- src/nvim/eval/userfunc.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/nvim/eval') diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c index dc7027980e..f5d1b1e870 100644 --- a/src/nvim/eval/userfunc.c +++ b/src/nvim/eval/userfunc.c @@ -144,10 +144,6 @@ static int get_function_args(char_u **argp, char_u endchar, garray_T *newargs, c = *p; *p = NUL; expr = vim_strsave(expr); - if (expr == NULL) { - *p = c; - goto err_ret; - } ((char_u **)(default_args->ga_data)) [default_args->ga_len] = expr; default_args->ga_len++; -- cgit From 607d1cc80dc8c559684822ba2d35bb71f634aafa Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 5 Jun 2021 12:03:40 -0400 Subject: fixup! vim-patch:8.2.2136: Vim9: Using uninitialized variable Resolve pvs/v560 error. mods is nonnull in the modified inner if-condition. because it is checked for NULL in the outer if-condition. --- src/nvim/eval/funcs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/eval') diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index caaf675db2..ce09d268ea 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -2547,7 +2547,7 @@ static void f_fnamemodify(typval_T *argvars, typval_T *rettv, FunPtr fptr) } else { len = strlen(fname); size_t usedlen = 0; - if (mods != NULL && *mods != NUL) { + if (*mods != NUL) { (void)modify_fname((char_u *)mods, false, &usedlen, (char_u **)&fname, &fbuf, &len); } -- cgit