mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 15:45:42 +00:00
FileSystem: Get rid of trailing nulls in GetWorkingDirectory()
This commit is contained in:
parent
fa9e50d7c1
commit
592a591b5f
|
@ -2480,11 +2480,17 @@ std::string GetWorkingDirectory()
|
|||
while (!getcwd(buffer.data(), buffer.size()))
|
||||
{
|
||||
if (errno != ERANGE)
|
||||
return {};
|
||||
{
|
||||
buffer.clear();
|
||||
break;
|
||||
}
|
||||
|
||||
buffer.resize(buffer.size() * 2);
|
||||
}
|
||||
|
||||
if (!buffer.empty())
|
||||
buffer.resize(std::strlen(buffer.c_str()));
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue