Skip to content

Commit

Permalink
Made newDataView size optional
Browse files Browse the repository at this point in the history
  • Loading branch information
EngineerSmith authored Jul 29, 2024
1 parent 9b362db commit f8d86a7
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 f8d86a7

Please sign in to comment.