Skip to content

Commit

Permalink
[core/os]: Fix read_console not stopping the read when newline can't …
Browse files Browse the repository at this point in the history
…fit in output slice
  • Loading branch information
flysand7 committed Jul 12, 2024
1 parent 1770e3a commit a7d95ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/os/file_windows.odin
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a7d95ab

Please sign in to comment.