1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Introduce proper error handling for file streams

This commit is contained in:
sfan5 2024-05-08 20:37:10 +02:00
parent c38e0d05bf
commit 39fd9b93c3
23 changed files with 235 additions and 149 deletions

View file

@ -298,7 +298,7 @@ int LuaAreaStore::l_from_file(lua_State *L)
const char *filename = luaL_checkstring(L, 2);
CHECK_SECURE_PATH(L, filename, false);
std::ifstream is(filename, std::ios::binary);
auto is = open_ifstream(filename, true);
return deserialization_helper(L, o->as, is);
}