terminate read if we read EOF
This commit is contained in:
1 parent
9da37ed394
commit
0e7109cab2
1 file changed
+3
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user