Fix #9015: Don't set free space value if not requested. (#9016)

This commit is contained in:
PeterN 2021-04-11 13:07:08 +01:00 committed by GitHub
parent df045b92ea
commit 56f982fa7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -247,7 +247,7 @@ bool FiosGetDiskFreeSpace(const char *path, uint64 *tot)
ULARGE_INTEGER bytes_free; ULARGE_INTEGER bytes_free;
bool retval = GetDiskFreeSpaceEx(OTTD2FS(path).c_str(), &bytes_free, nullptr, nullptr); bool retval = GetDiskFreeSpaceEx(OTTD2FS(path).c_str(), &bytes_free, nullptr, nullptr);
if (retval) *tot = bytes_free.QuadPart; if (retval && tot != nullptr) *tot = bytes_free.QuadPart;
SetErrorMode(sem); // reset previous setting SetErrorMode(sem); // reset previous setting
return retval; return retval;