BUG/MINOR: lua: error in detection of mandatory arguments

The last mandatory arguments in sample fetches or converters are
ignored. This is due to a bad control.
This commit is contained in:
Thierry FOURNIER 2015-03-13 12:21:07 +01:00 committed by Willy Tarreau
parent 933e5deb2b
commit dd6f4b43e2

View File

@ -530,7 +530,7 @@ __LJMP int hlua_lua2arg_check(lua_State *L, int first, struct arg *argp,
/* Check for mandatory arguments. */
if (argp[idx].type == ARGT_STOP) {
if (idx + 1 < min_arg)
if (idx < min_arg)
WILL_LJMP(luaL_argerror(L, first + idx, "Mandatory argument expected"));
return 0;
}