Fix create directory

This commit is contained in:
momo5502 2016-11-02 20:50:17 +01:00
parent 6cf28b4170
commit 93d096ed18

View File

@ -11,7 +11,11 @@ namespace Utils
void WriteFile(std::string file, std::string data)
{
CreateDirectory(file.substr(0, file.find_last_of("/\\")));
auto pos = file.find_last_of("/\\");
if (pos != std::string::npos)
{
CreateDirectory(file.substr(0, pos));
}
std::ofstream stream(file, std::ios::binary);