Skip to content

Commit

Permalink
Merge pull request #2088 from EngineerSmith/patch-1
Browse files Browse the repository at this point in the history
Made love.data.newDataView size arg optional
  • Loading branch information
slime73 authored Jul 29, 2024
2 parents 9b362db + f8d86a7 commit 8d4be76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/data/wrap_DataModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ int w_newDataView(lua_State *L)
Data *data = luax_checkdata(L, 1);

lua_Integer offset = luaL_checkinteger(L, 2);
lua_Integer size = luaL_checkinteger(L, 3);
lua_Integer size = luaL_optinteger(L, 3, data->getSize() - offset);

if (offset < 0 || size < 0)
return luaL_error(L, "DataView offset and size must not be negative.");
Expand Down

0 comments on commit 8d4be76

Please sign in to comment.