mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-02 19:24:12 +01:00
[util] Fix GetEnvironmentVariableW usage
This commit is contained in:
parent
3e26958906
commit
26a14c5175
@ -24,7 +24,9 @@ namespace dxvk::env {
|
||||
result.resize(MAX_PATH + 1);
|
||||
|
||||
DWORD len = ::GetEnvironmentVariableW(str::tows(name).c_str(), result.data(), MAX_PATH);
|
||||
result.resize(len);
|
||||
if (!len || len >= MAX_PATH)
|
||||
return "";
|
||||
result.resize(len + 1);
|
||||
|
||||
return str::fromws(result.data());
|
||||
#else
|
||||
@ -80,7 +82,9 @@ namespace dxvk::env {
|
||||
exePath.resize(MAX_PATH + 1);
|
||||
|
||||
DWORD len = ::GetModuleFileNameW(NULL, exePath.data(), MAX_PATH);
|
||||
exePath.resize(len);
|
||||
if (!len || len == MAX_PATH)
|
||||
return "";
|
||||
exePath.resize(len + 1);
|
||||
|
||||
return str::fromws(exePath.data());
|
||||
#elif defined(__linux__)
|
||||
|
Loading…
Reference in New Issue
Block a user