summaryrefslogtreecommitdiff
path: root/libguile/gsubr.c
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/gsubr.c')
-rw-r--r--libguile/gsubr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libguile/gsubr.c b/libguile/gsubr.c
index 06e8830c8..24ba6700c 100644
--- a/libguile/gsubr.c
+++ b/libguile/gsubr.c
@@ -205,6 +205,10 @@ scm_i_gsubr_apply (SCM proc, SCM arg, ...)
argv[argc] = arg;
if (SCM_UNLIKELY (argc < SCM_GSUBR_REQ (type)))
+ /* too few args */
+ scm_wrong_num_args (SCM_SUBR_NAME (proc));
+ if (SCM_UNLIKELY (!SCM_UNBNDP (arg) && !SCM_GSUBR_REST (type)))
+ /* too many args */
scm_wrong_num_args (SCM_SUBR_NAME (proc));
/* Fill in optional arguments that were not passed. */