Don't use wrong encoding for paths when opening streams on Windows

This commit is contained in:
JosJuice
2017-12-05 21:23:35 +01:00
parent 08da19fc87
commit 9d8a82e1d9
7 changed files with 14 additions and 8 deletions

View File

@ -12,6 +12,7 @@
#include "Common/CPUDetect.h"
#include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/StringUtil.h"
const char procfile[] = "/proc/cpuinfo";
@ -22,7 +23,8 @@ static std::string GetCPUString()
std::string cpu_string = "Unknown";
std::string line;
std::ifstream file(procfile);
std::ifstream file;
File::OpenFStream(file, procfile, std::ios_base::in);
if (!file)
return cpu_string;

View File

@ -124,7 +124,7 @@ public:
// failed to open file for reading or bad header
// close and recreate file
Close();
m_file.open(filename, ios_base::out | ios_base::trunc | ios_base::binary);
File::OpenFStream(m_file, filename, ios_base::out | ios_base::trunc | ios_base::binary);
WriteHeader();
return 0;
}