From 8d8aaf65aaaecfafd81c13bdfbcbc16e9eabe630 Mon Sep 17 00:00:00 2001 From: Oleksandr Kovalenko Date: Sat, 31 Jan 2026 15:01:56 +0200 Subject: [PATCH] os\os2 windows: fix truncate-clamp op order when determining to_read size --- core/os/os2/file_windows.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/os/os2/file_windows.odin b/core/os/os2/file_windows.odin index 4df9398cc..6f29d151c 100644 --- a/core/os/os2/file_windows.odin +++ b/core/os/os2/file_windows.odin @@ -377,7 +377,7 @@ _read_internal :: proc(f: ^File_Impl, p: []byte) -> (n: i64, err: Error) { sync.shared_guard(&f.rw_mutex) // multiple readers if sync.guard(&f.p_mutex) { - to_read := min(win32.DWORD(length), MAX_RW) + to_read := win32.DWORD(min(length, MAX_RW)) switch f.kind { case .Console: // NOTE(laytan): at least for now, just use ReadFile, it seems to work fine,