diff options
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -677,14 +677,16 @@ val apply(val fun, val arglist, val ctx_form) for (; arglist && p < arg + APPLY_ARGS; arglist = cdr(arglist)) *p++ = car(arglist); - if (arglist) - eval_error(ctx_form, lit("~s: too many arguments"), - ctx, nao); + nargs = p - arg; - if ((nargs = p - arg) < reqargs) + if (nargs < reqargs) eval_error(ctx_form, lit("~s: missing required arguments"), ctx, nao); + if (nargs > fixparam) + eval_error(ctx_form, lit("~s: too many arguments"), + ctx, nao); + for (; nargs < fixparam; nargs++) *p++ = colon_k; |