Browse Source

Zero `n` on error in `_file_stream_proc`

Feoramund 1 year ago
parent
commit
741ccd7ff5
1 changed files with 3 additions and 0 deletions
  1. 3 0
      core/os/stream.odin

+ 3 - 0
core/os/stream.odin

@@ -66,5 +66,8 @@ _file_stream_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte,
 	if err == nil && os_err != nil {
 		err = error_to_io_error(os_err)
 	}
+	if err != nil {
+		n = 0
+	}
 	return
 }