0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

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: #16537

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
John Marriott
2025-02-01 15:25:34 +01:00
committed by Christian Brabandt
parent 3219da514c
commit b32800f7c5
9 changed files with 192 additions and 114 deletions

View File

@@ -1934,6 +1934,7 @@ struct ufunc_S
char_u *uf_name_exp; // if "uf_name[]" starts with SNR the name with
// "<SNR>" as a string, otherwise NULL
size_t uf_namelen; // length of uf_name (excluding the NUL)
char_u uf_name[4]; // name of function (actual size equals name);
// can start with <SNR>123_ (<SNR> is K_SPECIAL
// KS_EXTRA KE_SNR)