From 7c8cbdb6ea168645b23ef281c4ef1afc3c8845bf Mon Sep 17 00:00:00 2001 From: Aetias Date: Fri, 23 Feb 2024 21:39:18 +0100 Subject: [PATCH] Fix `FileRead` on Win32 --- tools/include/util.h | 5 +++-- 1 file 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;