Explorar el Código

terminate read if we read EOF

Colin Davidson hace 2 años
padre
commit
0e7109cab2
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      core/os/os_darwin.odin

+ 3 - 0
core/os/os_darwin.odin

@@ -404,6 +404,9 @@ read :: proc(fd: Handle, data: []u8) -> (int, Errno) {
 		if bytes_read == -1 {
 			return bytes_read_total, 1
 		}
+		if bytes_read == 0 {
+			break
+		}
 		bytes_read_total += bytes_read
 	}