ModernUO icon indicating copy to clipboard operation
ModernUO copied to clipboard

Possible bug in SpanReader.cs

Open Uniphix opened this issue 6 months ago • 1 comments

https://github.com/modernuo/ModernUO/blob/main/Projects/Server/Buffers/SpanReader.cs#L299

On this line...

Shouldn't that be if( bytes.Length < Position )?

Uniphix avatar Jun 05 '25 04:06 Uniphix

Should be if (bytes.Length > Remaining)

Bohicatv avatar Jun 05 '25 05:06 Bohicatv

It is normal in C# for Read(dest) to read fewer bytes.

Just in case, I fixed the exception handling and added massive number of tests. Thanks for looking into this.

kamronbatman avatar Nov 13 '25 07:11 kamronbatman