MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / str_char

Function str_char

third-party/lua-5.5.0/src/lstrlib.c:184–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182
183
184static int str_char (lua_State *L) {
185 int n = lua_gettop(L); /* number of arguments */
186 int i;
187 luaL_Buffer b;
188 char *p = luaL_buffinitsize(L, &b, cast_uint(n));
189 for (i=1; i<=n; i++) {
190 lua_Unsigned c = (lua_Unsigned)luaL_checkinteger(L, i);
191 luaL_argcheck(L, c <= (lua_Unsigned)UCHAR_MAX, i, "value out of range");
192 p[i - 1] = cast_char(cast_uchar(c));
193 }
194 luaL_pushresultsize(&b, cast_uint(n));
195 return 1;
196}
197
198
199/*

Callers

nothing calls this directly

Calls 4

lua_gettopFunction · 0.70
luaL_buffinitsizeFunction · 0.70
luaL_checkintegerFunction · 0.70
luaL_pushresultsizeFunction · 0.70

Tested by

no test coverage detected