Skip to content

Commit ca4e15c

Browse files
author
rstam
committed
Fixed comparisons in ReadString and ReadString to compare against 128 instead of 127.
1 parent 62c5966 commit ca4e15c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Bson/IO/BsonBuffer.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,10 +543,10 @@ public string ReadString()
543543

544544
// special case single character strings
545545
case 2:
546-
var c = _chunk[_chunkOffset];
547-
if (c < 127)
546+
var c1 = _chunk[_chunkOffset];
547+
if (c1 < 128)
548548
{
549-
value = __asciiStringTable[c];
549+
value = __asciiStringTable[c1];
550550
}
551551
else
552552
{
@@ -609,7 +609,7 @@ public string ReadCString()
609609
if (_chunk[_chunkOffset + 1] == 0)
610610
{
611611
string value;
612-
if (c1 < 127)
612+
if (c1 < 128)
613613
{
614614
value = __asciiStringTable[c1];
615615
}

0 commit comments

Comments
 (0)