summaryrefslogtreecommitdiff
path: root/src/os/windows/win32.cpp
diff options
context:
space:
mode:
authorPeterN <peter1138@openttd.org>2021-04-11 13:07:08 +0100
committerGitHub <noreply@github.com>2021-04-11 13:07:08 +0100
commit56f982fa7f6da6134cff0d81040ebdf39b72ea2d (patch)
tree78b37a1afe20dfb8a70800a430cb8cdced38bc98 /src/os/windows/win32.cpp
parentdf045b92ea45ef757dfcfded4b72028ee18ebf0d (diff)
downloadopenttd-56f982fa7f6da6134cff0d81040ebdf39b72ea2d.tar.xz
Fix #9015: Don't set free space value if not requested. (#9016)
Diffstat (limited to 'src/os/windows/win32.cpp')
-rw-r--r--src/os/windows/win32.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/os/windows/win32.cpp b/src/os/windows/win32.cpp
index 073f70b98..ddcfd4866 100644
--- a/src/os/windows/win32.cpp
+++ b/src/os/windows/win32.cpp
@@ -247,7 +247,7 @@ bool FiosGetDiskFreeSpace(const char *path, uint64 *tot)
ULARGE_INTEGER bytes_free;
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
return retval;