From 3a4b22c6b16b10d2e7827a3c5fbc196eb34b16d8 Mon Sep 17 00:00:00 2001 From: disarray2077 <86157825+disarray2077@users.noreply.github.com> Date: Thu, 4 May 2023 23:57:58 -0300 Subject: [PATCH] Fix ReadBuffer --- BeefLibs/corlib/src/IO/StreamReader.bf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BeefLibs/corlib/src/IO/StreamReader.bf b/BeefLibs/corlib/src/IO/StreamReader.bf index a06e38f7..c3a5a4b9 100644 --- a/BeefLibs/corlib/src/IO/StreamReader.bf +++ b/BeefLibs/corlib/src/IO/StreamReader.bf @@ -441,7 +441,7 @@ namespace System.IO bytePos = byteLen = 0;*/ } - return mCharLen; + return mCharLen - mCharPos; } mByteLen += len; @@ -461,7 +461,7 @@ namespace System.IO //Contract.Assert(byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); if (mByteLen == 0) // We're at EOF - return mCharLen; + return mCharLen - mCharPos; } // _isBlocked == whether we read fewer bytes than we asked for. @@ -510,7 +510,7 @@ namespace System.IO while (mCharLen == mCharPos); //Console.WriteLine("ReadBuffer called. chars: "+char8Len); - return mCharLen; + return mCharLen - mCharPos; } int GetChars(uint8[] byteBuffer, int byteOffset, int byteLength, char8[] char8Buffer, int char8Offset)