How to limit the amount of characters in a Lua string
snippet in lua

How to limit the amount of characters in a Lua string

user8822

size_t arg_len;
lua_tolstring(L, 1, &arg_len);
if (arg_len > 8) return luaL_error(L, "argument too long");