mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
FileUtil: handle some error conditions
This commit is contained in:
parent
3bc8a26083
commit
49590c9a42
@ -600,7 +600,7 @@ std::string GetCurrentDir()
|
|||||||
if (!dir)
|
if (!dir)
|
||||||
{
|
{
|
||||||
ERROR_LOG(COMMON, "GetCurrentDirectory failed: %s", LastStrerrorString().c_str());
|
ERROR_LOG(COMMON, "GetCurrentDirectory failed: %s", LastStrerrorString().c_str());
|
||||||
return nullptr;
|
return "";
|
||||||
}
|
}
|
||||||
std::string strDir = dir;
|
std::string strDir = dir;
|
||||||
free(dir);
|
free(dir);
|
||||||
@ -621,10 +621,15 @@ std::string CreateTempDir()
|
|||||||
return "";
|
return "";
|
||||||
|
|
||||||
GUID guid;
|
GUID guid;
|
||||||
CoCreateGuid(&guid);
|
if (FAILED(CoCreateGuid(&guid)))
|
||||||
TCHAR tguid[40];
|
{
|
||||||
StringFromGUID2(guid, tguid, 39);
|
return "";
|
||||||
tguid[39] = 0;
|
}
|
||||||
|
OLECHAR tguid[40]{};
|
||||||
|
if (!StringFromGUID2(guid, tguid, _countof(tguid)))
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
std::string dir = TStrToUTF8(temp) + "/" + TStrToUTF8(tguid);
|
std::string dir = TStrToUTF8(temp) + "/" + TStrToUTF8(tguid);
|
||||||
if (!CreateDir(dir))
|
if (!CreateDir(dir))
|
||||||
return "";
|
return "";
|
||||||
|
Loading…
Reference in New Issue
Block a user