mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 07:08:48 +00:00
[core/os]: Fix read_console not stopping the read when newline can't fit in output slice
This commit is contained in:
@@ -125,7 +125,7 @@ read_console :: proc(handle: win32.HANDLE, b: []byte) -> (n: int, err: Errno) {
|
|||||||
src := buf8[:buf8_len]
|
src := buf8[:buf8_len]
|
||||||
|
|
||||||
ctrl_z := false
|
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]
|
x := src[i]
|
||||||
if x == 0x1a { // ctrl-z
|
if x == 0x1a { // ctrl-z
|
||||||
ctrl_z = true
|
ctrl_z = true
|
||||||
|
|||||||
Reference in New Issue
Block a user