| 182 | |
| 183 | |
| 184 | static 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 | /* |
nothing calls this directly
no test coverage detected