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:
parent
c38e0d05bf
commit
39fd9b93c3
23 changed files with 235 additions and 149 deletions
|
@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "texture_override.h"
|
||||
|
||||
#include "log.h"
|
||||
#include "filesys.h"
|
||||
#include "util/string.h"
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
|
@ -48,7 +49,7 @@ static const std::map<std::string, OverrideTarget> override_LUT = {
|
|||
|
||||
TextureOverrideSource::TextureOverrideSource(const std::string &filepath)
|
||||
{
|
||||
std::ifstream infile(filepath.c_str());
|
||||
auto infile = open_ifstream(filepath.c_str(), false);
|
||||
std::string line;
|
||||
int line_index = 0;
|
||||
while (std::getline(infile, line)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue