From f79b4568ae2cffc0eed033ff9029f4f637bc28bd Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 8 Feb 2016 10:55:19 -0200 Subject: details (removed silly use of 'luaL_opt' + better error messages in cases of "table expected") --- ltablib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ltablib.c') diff --git a/ltablib.c b/ltablib.c index 638413c6..ace60547 100644 --- a/ltablib.c +++ b/ltablib.c @@ -1,5 +1,5 @@ /* -** $Id: ltablib.c,v 1.90 2015/11/25 12:48:57 roberto Exp roberto $ +** $Id: ltablib.c,v 1.91 2015/12/14 11:57:38 roberto Exp roberto $ ** Library for Table Manipulation ** See Copyright Notice in lua.h */ @@ -53,7 +53,7 @@ static void checktab (lua_State *L, int arg, int what) { lua_pop(L, n); /* pop metatable and tested metamethods */ } else - luaL_argerror(L, arg, "table expected"); /* force an error */ + luaL_checktype(L, arg, LUA_TTABLE); /* force an error */ } } @@ -172,7 +172,7 @@ static int tconcat (lua_State *L) { size_t lsep; const char *sep = luaL_optlstring(L, 2, "", &lsep); lua_Integer i = luaL_optinteger(L, 3, 1); - last = luaL_opt(L, luaL_checkinteger, 4, last); + last = luaL_optinteger(L, 4, last); luaL_buffinit(L, &b); for (; i < last; i++) { addfield(L, &b, i); -- cgit v1.2.3-55-g6feb