summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2023-01-09 11:35:47 +0000
committerBram Moolenaar <Bram@vim.org>2023-01-09 11:35:47 +0000
commitc8ab30a349ee45ef6c3b6af8ee5ff53d2f7bf891 (patch)
treedab7e56ef277b57f5469f13b286233e514bb677d
parente01e5215f927f83778ad7494abb0007aa52d08c3 (diff)
downloadvim-git-c8ab30a349ee45ef6c3b6af8ee5ff53d2f7bf891.tar.gz
patch 9.0.1161: Coverity warns for using strcpy()v9.0.1161
Problem: Coverity warns for using strcpy(). Solution: Call a function to set the function name.
-rw-r--r--src/userfunc.c7
-rw-r--r--src/version.c2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/userfunc.c b/src/userfunc.c
index bdec34ded..3ff49c9dd 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -2585,8 +2585,6 @@ copy_lambda_to_global_func(
|| ga_copy_strings(&ufunc->uf_lines, &fp->uf_lines) == FAIL)
goto failed;
- fp->uf_name_exp = ufunc->uf_name_exp == NULL ? NULL
- : vim_strsave(ufunc->uf_name_exp);
if (ufunc->uf_arg_types != NULL)
{
fp->uf_arg_types = ALLOC_MULT(type_T *, fp->uf_args.ga_len);
@@ -2604,7 +2602,10 @@ copy_lambda_to_global_func(
fp->uf_ret_type = ufunc->uf_ret_type;
fp->uf_refcount = 1;
- STRCPY(fp->uf_name, global);
+
+ fp->uf_name_exp = NULL;
+ set_ufunc_name(fp, global);
+
hash_add(&func_hashtab, UF2HIKEY(fp), "copy lambda");
// the referenced dfunc_T is now used one more time
diff --git a/src/version.c b/src/version.c
index 021f1b55b..d53f809fa 100644
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1161,
+/**/
1160,
/**/
1159,