Fix indentation

This commit is contained in:
Vitalii Kravchenko
2022-10-02 07:47:22 +01:00
parent 8a5b39f734
commit d52a9b61af
+10 -10
View File
@@ -375,18 +375,18 @@ MAX_RW :: 0x7fffffff // The limit on Darwin is max(i32), trying to read/write mo
write :: proc(fd: Handle, data: []u8) -> (int, Errno) { write :: proc(fd: Handle, data: []u8) -> (int, Errno) {
assert(fd != -1) assert(fd != -1)
bytes_total := len(data) bytes_total := len(data)
bytes_written_total := 0 bytes_written_total := 0
for bytes_written_total < bytes_total { for bytes_written_total < bytes_total {
bytes_to_write := min(bytes_total - bytes_written_total, MAX_RW) bytes_to_write := min(bytes_total - bytes_written_total, MAX_RW)
slice := data[bytes_written_total:bytes_written_total + bytes_to_write] slice := data[bytes_written_total:bytes_written_total + bytes_to_write]
bytes_written := _unix_write(fd, raw_data(slice), bytes_to_write) bytes_written := _unix_write(fd, raw_data(slice), bytes_to_write)
if bytes_written == -1 { if bytes_written == -1 {
return bytes_written_total, 1 return bytes_written_total, 1
} }
bytes_written_total += bytes_written bytes_written_total += bytes_written
} }
return bytes_written_total, 0 return bytes_written_total, 0
} }