Skip to content

Commit

Permalink
replaced Seek(Pos-1) with Seek(-1, CUR)
Browse files Browse the repository at this point in the history
  • Loading branch information
arekbulski committed Apr 11, 2018
1 parent 8f7c230 commit 90c9228
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions KaitaiStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,10 @@ public byte[] ReadBytesTerm(byte terminator, bool includeTerminator, bool consum
byte b = ReadByte();
if (b == terminator)
{
if (includeTerminator) bytes.Add(b);
if (!consumeTerminator) Seek(Pos - 1);
if (includeTerminator)
bytes.Add(b);
if (!consumeTerminator)
BaseStream.Seek(-1, SeekOrigin.Current);
break;
}
bytes.Add(b);
Expand Down

0 comments on commit 90c9228

Please sign in to comment.