summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/proc.c b/proc.c
index 50e09d76e7..fb286fa42b 100644
--- a/proc.c
+++ b/proc.c
@@ -2993,8 +2993,7 @@ proc_curry(int argc, const VALUE *argv, VALUE self)
int sarity, max_arity, min_arity = rb_proc_min_max_arity(self, &max_arity);
VALUE arity;
- rb_scan_args(argc, argv, "01", &arity);
- if (NIL_P(arity)) {
+ if (rb_check_arity(argc, 0, 1) == 0 || NIL_P(arity = argv[0])) {
arity = INT2FIX(min_arity);
}
else {