Fix flipped condition when writing buffer data;

This commit is contained in:
bjorn 2023-04-02 10:09:06 -07:00
parent 9c054c0515
commit 01ba9927c1
1 changed files with 1 additions and 1 deletions

View File

@ -265,7 +265,7 @@ void luax_readbufferdata(lua_State* L, int index, Buffer* buffer, char* data) {
luaL_checktype(L, index, LUA_TTABLE);
lovrCheck(info->fields, "Buffer must be created with format information to copy a table to it");
if (info->fields[0].length > 0) {
if (info->fields[0].length == 0) {
data = data ? data : lovrBufferMap(buffer, 0, info->size);
luax_readbufferfield(L, index, info->fields, data);
} else {