aboutsummaryrefslogtreecommitdiffstats
path: root/ext.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext.c')
-rw-r--r--ext.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext.c b/ext.c
index c16ab60a..c0d6f150 100644
--- a/ext.c
+++ b/ext.c
@@ -99,7 +99,7 @@ make_builtin(const awk_ext_func_t *funcinfo)
const char *sp;
char c;
const char *name = funcinfo->name;
- int count = funcinfo->num_expected_args;
+ int count = funcinfo->max_expected_args;
sp = name;
if (sp == NULL || *sp == '\0')
@@ -156,10 +156,9 @@ get_argument(int i)
INSTRUCTION *pc;
pc = TOP()->code_ptr; /* Op_ext_builtin instruction */
- pcount = (pc + 1)->expr_count; /* max # of arguments */
arg_count = pc->expr_count; /* # of arguments supplied */
- if (i < 0 || i >= pcount || i >= arg_count)
+ if (i < 0 || i >= arg_count)
return NULL;
t = PEEK(arg_count - i);