Patch 9.0.1161
Problem: Coverity warns for using strcpy().
Solution: Call a function to set the function name.
Files: src/userfunc.c
*** ../vim-9.0.1160/src/userfunc.c 2023-01-08 20:31:14.564705856 +0000
--- src/userfunc.c 2023-01-09 11:33:31.894074704 +0000
***************
*** 2585,2592 ****
|| 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);
--- 2585,2590 ----
***************
*** 2604,2610 ****
fp->uf_ret_type = ufunc->uf_ret_type;
fp->uf_refcount = 1;
! STRCPY(fp->uf_name, global);
hash_add(&func_hashtab, UF2HIKEY(fp), "copy lambda");
// the referenced dfunc_T is now used one more time
--- 2602,2611 ----
fp->uf_ret_type = ufunc->uf_ret_type;
fp->uf_refcount = 1;
!
! 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
*** ../vim-9.0.1160/src/version.c 2023-01-08 20:31:14.564705856 +0000
--- src/version.c 2023-01-09 11:34:34.689812406 +0000
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1161,
/**/
--
Hacker: Someone skilled in computer programming (good guy).
Cracker: A hacker that uses his skills to crack software (bad guy).
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///