diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-08-02 11:49:00 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2024-08-02 12:16:19 +0800 |
commit | 6d722f33098da447ac29496b71dd58f2ae337996 (patch) | |
tree | 0ea18e41a86f2645e43b797af579c5d33c833254 /src/nvim/eval | |
parent | 582bf4f1e15988565da53a91395e2d0131628fbb (diff) | |
download | rneovim-6d722f33098da447ac29496b71dd58f2ae337996.tar.gz rneovim-6d722f33098da447ac29496b71dd58f2ae337996.tar.bz2 rneovim-6d722f33098da447ac29496b71dd58f2ae337996.zip |
vim-patch:9.1.0649: Wrong comment for "len" argument of call_simple_func()
Problem: Wrong comment for "len" argument of call_simple_func().
Solution: Remove the "or -1 to use strlen()". Also change its type to
size_t to remove one cast. (zeertzjq)
closes: vim/vim#15410
https://github.com/vim/vim/commit/c1ed788c1b41db9b5f1ef548dc877f771f535bbe
Diffstat (limited to 'src/nvim/eval')
-rw-r--r-- | src/nvim/eval/userfunc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c index f7d1e7e0f8..3690ab5d7b 100644 --- a/src/nvim/eval/userfunc.c +++ b/src/nvim/eval/userfunc.c @@ -1782,9 +1782,9 @@ theend: /// Returns NOTDONE when the function could not be found. /// /// @param funcname name of the function -/// @param len length of "name" or -1 to use strlen() +/// @param len length of "name" /// @param rettv return value goes here -int call_simple_func(const char *funcname, int len, typval_T *rettv) +int call_simple_func(const char *funcname, size_t len, typval_T *rettv) FUNC_ATTR_NONNULL_ALL { int ret = FAIL; @@ -1793,7 +1793,7 @@ int call_simple_func(const char *funcname, int len, typval_T *rettv) rettv->vval.v_number = 0; // Make a copy of the name, an option can be changed in the function. - char *name = xstrnsave(funcname, (size_t)len); + char *name = xstrnsave(funcname, len); int error = FCERR_NONE; char *tofree = NULL; |