diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-04-03 21:05:23 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-04-03 21:05:23 -0700 |
commit | 02f21d78ee7e14f23fb5f708a08c7273f48eb6d5 (patch) | |
tree | c503280e37d50076431c51b6df1a65942b1c90a9 | |
parent | 592bb72c0f738b0227a8986e66e43f5937fb4ff9 (diff) | |
download | txr-02f21d78ee7e14f23fb5f708a08c7273f48eb6d5.tar.gz txr-02f21d78ee7e14f23fb5f708a08c7273f48eb6d5.tar.bz2 txr-02f21d78ee7e14f23fb5f708a08c7273f48eb6d5.zip |
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.
-rw-r--r-- | lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; } |