From 02f21d78ee7e14f23fb5f708a08c7273f48eb6d5 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 3 Apr 2021 21:05:23 -0700 Subject: func-optparam-count: bugfix. * lib.c (get_param_counts): If there are no optional parameters, then the oa variable stays negative; we must turn that into a zero, otherwise we return the bogus value -1 as the number of optional arguments. --- lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib.c b/lib.c index 89f01344..dcf9e870 100644 --- a/lib.c +++ b/lib.c @@ -7168,7 +7168,7 @@ static val get_param_counts(val params, cnum *fixparam, cnum *optparam) } *fixparam = fx; - *optparam = oa; + *optparam = (oa > 0) ? oa : 0; return params; } -- cgit v1.2.3