Browse Source

Merge pull request #2164 from colrdavidson/fix-osx-read

terminate read if we read EOF
Jeroen van Rijn 2 years ago
parent
commit
f8228e305a
1 changed files with 3 additions and 0 deletions
  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 {
 		if bytes_read == -1 {
 			return bytes_read_total, 1
 			return bytes_read_total, 1
 		}
 		}
+		if bytes_read == 0 {
+			break
+		}
 		bytes_read_total += bytes_read
 		bytes_read_total += bytes_read
 	}
 	}