Browse Source

Don't append to buffer if nothing was read

flysand7 10 months ago
parent
commit
f61996fd6f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      core/os/os2/process.odin

+ 2 - 2
core/os/os2/process.odin

@@ -405,10 +405,10 @@ process_exec :: proc(
 		defer stderr = stderr_b[:]
 
 		buf: [1024]u8 = ---
-		n: int
-
+		
 		stdout_done, stderr_done, has_data: bool
 		for err == nil && (!stdout_done || !stderr_done) {
+			n := 0
 
 			if !stdout_done {
 				has_data, err = pipe_has_data(stdout_r)