summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-09-07 12:21:46 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-09-07 12:21:46 -0300
commitcd56f222b735a6b2c5392c74904b6c744af2e549 (patch)
tree03a2474284046c17073aeeb15fb656f8ee9c35db
parent69b77b6fde32cdf5dcaeeb92996bf6c4697e0b4f (diff)
downloadlua-github-cd56f222b735a6b2c5392c74904b6c744af2e549.tar.gz
Corrected error message in 'table.remove'
-rw-r--r--ltablib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ltablib.c b/ltablib.c
index 868d78fd..e6bc4d04 100644
--- a/ltablib.c
+++ b/ltablib.c
@@ -93,7 +93,7 @@ static int tremove (lua_State *L) {
lua_Integer pos = luaL_optinteger(L, 2, size);
if (pos != size) /* validate 'pos' if given */
/* check whether 'pos' is in [1, size + 1] */
- luaL_argcheck(L, (lua_Unsigned)pos - 1u <= (lua_Unsigned)size, 1,
+ luaL_argcheck(L, (lua_Unsigned)pos - 1u <= (lua_Unsigned)size, 2,
"position out of bounds");
lua_geti(L, 1, pos); /* result = t[pos] */
for ( ; pos < size; pos++) {