diff options
author | zeertzjq <zeertzjq@outlook.com> | 2025-02-02 08:23:48 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2025-02-03 11:27:56 +0800 |
commit | b853ef770a25fcd91def6c5016d65c336897c2cc (patch) | |
tree | 54c327f87c662504d7803abf1ee16a5312295770 /src/nvim/eval/typval_defs.h | |
parent | 82b029cbb00dbe9649824f7795c177974955d683 (diff) | |
download | rneovim-b853ef770a25fcd91def6c5016d65c336897c2cc.tar.gz rneovim-b853ef770a25fcd91def6c5016d65c336897c2cc.tar.bz2 rneovim-b853ef770a25fcd91def6c5016d65c336897c2cc.zip |
vim-patch:9.1.1063: too many strlen() calls in userfunc.c
Problem: too many strlen() calls in userfunc.c
Solution: refactor userfunc.c and remove calls to strlen(),
drop set_ufunc_name() and roll it into alloc_ufunc(),
check for out-of-memory condition in trans_function_name_ext()
(John Marriott)
closes: vim/vim#16537
https://github.com/vim/vim/commit/b32800f7c51c866dc0e87244eb4902540982309d
Add missing change to call_user_func() from patch 8.1.1007.
Consistently use PRIdSCID instead of PRId64 for script IDs.
Co-authored-by: John Marriott <basilisk@internode.on.net>
Diffstat (limited to 'src/nvim/eval/typval_defs.h')
-rw-r--r-- | src/nvim/eval/typval_defs.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/eval/typval_defs.h b/src/nvim/eval/typval_defs.h index 1ec7631c4b..90b0d4e4a9 100644 --- a/src/nvim/eval/typval_defs.h +++ b/src/nvim/eval/typval_defs.h @@ -357,9 +357,10 @@ struct ufunc { funccall_T *uf_scoped; ///< l: local variables for closure char *uf_name_exp; ///< if "uf_name[]" starts with SNR the name with ///< "<SNR>" as a string, otherwise NULL - char uf_name[]; ///< Name of function (actual size equals name); - ///< can start with <SNR>123_ - ///< (<SNR> is K_SPECIAL KS_EXTRA KE_SNR) + size_t uf_namelen; ///< Length of uf_name (excluding the NUL) + char uf_name[]; ///< Name of function (actual size equals name); + ///< can start with <SNR>123_ + ///< (<SNR> is K_SPECIAL KS_EXTRA KE_SNR) }; struct partial_S { |