diff options
Diffstat (limited to 'ext.c')
-rw-r--r-- | ext.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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); |