mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix utf8.tostring
This commit is contained in:
parent
04c25ef214
commit
6e6de5fc24
1 changed files with 2 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ static int l_tobytes(lua::State* L) {
|
|||
|
||||
static int l_tostring(lua::State* L) {
|
||||
if (lua::istable(L, 1)) {
|
||||
lua::pushvalue(L, 1);
|
||||
size_t size = lua::objlen(L, 1);
|
||||
util::Buffer<char> buffer(size);
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
|
|
@ -32,6 +33,7 @@ static int l_tostring(lua::State* L) {
|
|||
buffer[i] = lua::tointeger(L, -1);
|
||||
lua::pop(L);
|
||||
}
|
||||
lua::pop(L);
|
||||
return lua::pushlstring(L, buffer.data(), size);
|
||||
} else if (auto bytes = lua::touserdata<lua::LuaBytearray>(L, 1)) {
|
||||
return lua::pushstring(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue