mirror of
https://github.com/neovim/neovim.git
synced 2025-09-05 19:08:15 +00:00
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
c1ed788c1b
This commit is contained in:
@@ -2630,7 +2630,7 @@ static int may_call_simple_func(char *arg, typval_T *rettv)
|
||||
if (parens != NULL && *skipwhite(parens + 2) == NUL) {
|
||||
char *p = strncmp(arg, "<SNR>", 5) == 0 ? skipdigits(arg + 5) : arg;
|
||||
if (to_name_end(p, true) == parens) {
|
||||
r = call_simple_func(arg, (int)(parens - arg), rettv);
|
||||
r = call_simple_func(arg, (size_t)(parens - arg), rettv);
|
||||
}
|
||||
}
|
||||
return r;
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user