diff options
| author | Aetias <aetias@outlook.com> | 2024-02-23 21:39:18 +0100 |
|---|---|---|
| committer | Aetias <aetias@outlook.com> | 2024-02-23 21:39:18 +0100 |
| commit | 7c8cbdb6ea168645b23ef281c4ef1afc3c8845bf (patch) | |
| tree | 83ec2f222b011c6e7f1e360f0d7d82864df9b063 | |
| parent | 1281ac1340daec4293a79258dd70e05a8f4fe422 (diff) | |
Fix `FileRead` on Win32
| -rw-r--r-- | tools/include/util.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/include/util.h b/tools/include/util.h index 5c06427c..519eb2fd 100644 --- a/tools/include/util.h +++ b/tools/include/util.h @@ -128,8 +128,9 @@ void FileClose(File *file) { size_t FileRead(const File *file, void *buf, size_t size, size_t count) { #ifdef __UTIL_WINDOWS DWORD bytesRead; - if (ReadFile(file->handle, buf, size * count, &bytesRead, NULL)) return true; - if (bytesRead > 0) return bytesRead / size; + if (ReadFile(file->handle, buf, size * count, &bytesRead, NULL)) { + if (bytesRead > 0) return bytesRead / size; + } #elif defined(__UTIL_LINUX) size_t countRead = fread(buf, size, count, file->fp); if (countRead > 0) return countRead; |
