> The library function luaL_checkstring, like all luaL_check* series, > return a valid value if the type is the expected one, or signals an > error when the type is not correct. Maybe what you were really looking for is lua_tolstring ?