From 61808f82f669085669aedd7dd2f201b9520d5a11 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 18 Mar 2026 15:29:12 -0400 Subject: [PATCH] Fix build --- SabreTools.IO/SabreTools.IO/Transform.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/SabreTools.IO/SabreTools.IO/Transform.cs b/SabreTools.IO/SabreTools.IO/Transform.cs index 1328816..ebe5681 100644 --- a/SabreTools.IO/SabreTools.IO/Transform.cs +++ b/SabreTools.IO/SabreTools.IO/Transform.cs @@ -445,25 +445,23 @@ namespace SabreTools.IO // If the buffer pointer has been reset if (pos == 0) { - output.Write(buffer); + output.Write(buffer, 0, buffer.Length); output.Flush(); buffer = new byte[4]; } } // If there's anything more in the buffer - for (int i = 0; i < pos; i++) - { + if (pos > 0) output.Write(buffer, 0, pos); - } // If the stream still has data if (input.Position < input.Length) { - int count = (int)(input.Length - input.Position); - byte[] bytes = new byte[count]; - input.Read(bytes, 0, count); - output.Write(bytes); + int remaining = (int)(input.Length - input.Position); + byte[] bytes = new byte[remaining]; + int read = input.Read(bytes, 0, remaining); + output.Write(bytes, 0, read); output.Flush(); }