Skip to content
Permalink
Browse files

Fix issues with NULL char not being treated properly (Thanks tornato)

  • Loading branch information...
UnknownShadow200 committed Nov 25, 2017
1 parent 0b5b107 commit b183800c928ec386b08a43e7abe0feb6f22d03b0
Showing with 2 additions and 2 deletions.
  1. +2 −2 fCraft/Network/PacketReader.cs
@@ -42,8 +42,8 @@ sealed class PacketReader : BinaryReader {
byte[] data = ReadBytes( Packet.StringSize );
for( int i = Packet.StringSize - 1; i >= 0; i-- ) {
byte code = data[i];
if( length == 0 && !(code == 0 || code == 0x20) )
length = i + 1;
if (code == 0) code = 0x20; // NULL to space
if (length == 0 && code != 0x20) { length = i + 1; }

// Treat code as an index in code page 437
if( code < 0x20 ) {

0 comments on commit b183800

Please sign in to comment.
You can’t perform that action at this time.