diff options
Diffstat (limited to 'src/vim9execute.c')
-rw-r--r-- | src/vim9execute.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vim9execute.c b/src/vim9execute.c index f6456d64b2..9ee795d25f 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -367,6 +367,16 @@ call_dfunc( semsg(_(e_nr_arguments_too_many), -arg_to_add); return FAIL; } + else if (arg_to_add > ufunc->uf_def_args.ga_len) + { + int missing = arg_to_add - ufunc->uf_def_args.ga_len; + + if (missing == 1) + emsg(_(e_one_argument_too_few)); + else + semsg(_(e_nr_arguments_too_few), missing); + return FAIL; + } // Reserve space for: // - missing arguments |