diff options
| author | flysand7 <thebumboni@gmail.com> | 2024-07-12 20:23:19 +1100 |
|---|---|---|
| committer | flysand7 <thebumboni@gmail.com> | 2024-07-12 20:28:38 +1100 |
| commit | a7d95ab3e1392ba5facb044a321c578565566fdb (patch) | |
| tree | cae161d4d033839a60c59200e8bfc4b804d13d26 | |
| parent | 1770e3a9a97620125f6333db7678dd4ec34fa329 (diff) | |
[core/os]: Fix read_console not stopping the read when newline can't fit in output slice
| -rw-r--r-- | core/os/file_windows.odin | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/os/file_windows.odin b/core/os/file_windows.odin index 3efe30d17..d900c5e70 100644 --- a/core/os/file_windows.odin +++ b/core/os/file_windows.odin @@ -125,7 +125,7 @@ read_console :: proc(handle: win32.HANDLE, b: []byte) -> (n: int, err: Errno) { src := buf8[:buf8_len] ctrl_z := false - for i := 0; i < len(src) && n+i < len(b); i += 1 { + for i := 0; i < len(src) && n < len(b); i += 1 { x := src[i] if x == 0x1a { // ctrl-z ctrl_z = true |