| 193 | |
| 194 | |
| 195 | static int str_char (lua_State *L) { |
| 196 | int n = lua_gettop(L); /* number of arguments */ |
| 197 | int i; |
| 198 | luaL_Buffer b; |
| 199 | char *p = luaL_buffinitsize(L, &b, n); |
| 200 | for (i=1; i<=n; i++) { |
| 201 | lua_Unsigned c = (lua_Unsigned)luaL_checkinteger(L, i); |
| 202 | luaL_argcheck(L, c <= (lua_Unsigned)UCHAR_MAX, i, "value out of range"); |
| 203 | p[i - 1] = uchar(c); |
| 204 | } |
| 205 | luaL_pushresultsize(&b, n); |
| 206 | return 1; |
| 207 | } |
| 208 | |
| 209 | |
| 210 | /* |
nothing calls this directly
no test coverage detected