From 99348ad738f924a51d8c907a81fbe0cfd506366c Mon Sep 17 00:00:00 2001 From: jaysunxiao Date: Wed, 13 Oct 2021 11:48:54 +0800 Subject: [PATCH] =?UTF-8?q?fix[protocol]:=20=E4=BF=AE=E5=A4=8DC#=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=86=99=E7=B4=A2=E5=BC=95=E7=9A=84=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocol/src/main/resources/cs/Buffer/ByteBuffer.cs | 2 +- .../src/test/resources/csTest/CsProtocol/Buffer/ByteBuffer.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol/src/main/resources/cs/Buffer/ByteBuffer.cs b/protocol/src/main/resources/cs/Buffer/ByteBuffer.cs index faf82c58..cfd6f428 100644 --- a/protocol/src/main/resources/cs/Buffer/ByteBuffer.cs +++ b/protocol/src/main/resources/cs/Buffer/ByteBuffer.cs @@ -58,7 +58,7 @@ namespace CsProtocol.Buffer public void SetWriteOffset(int writeIndex) { - if (writeOffset > buffer.Length) + if (writeIndex > buffer.Length) { throw new Exception("writeIndex[" + writeIndex + "] out of bounds exception: readerIndex: " + readOffset + ", writerIndex: " + writeOffset + diff --git a/protocol/src/test/resources/csTest/CsProtocol/Buffer/ByteBuffer.cs b/protocol/src/test/resources/csTest/CsProtocol/Buffer/ByteBuffer.cs index a86da2ef..0a1257ac 100644 --- a/protocol/src/test/resources/csTest/CsProtocol/Buffer/ByteBuffer.cs +++ b/protocol/src/test/resources/csTest/CsProtocol/Buffer/ByteBuffer.cs @@ -56,7 +56,7 @@ namespace CsProtocol.Buffer public void SetWriteOffset(int writeIndex) { - if (writeOffset > buffer.Length) + if (writeIndex > buffer.Length) { throw new Exception("writeIndex[" + writeIndex + "] out of bounds exception: readerIndex: " + readOffset + ", writerIndex: " + writeOffset +