Skip to content

Commit

Permalink
Fixes #45
Browse files Browse the repository at this point in the history
  • Loading branch information
andreashuber-lawo committed May 10, 2017
1 parent 1d38bfd commit 001d5fa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Lawo.EmberPlusSharp/Ember/EmberReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ public bool Read()
this.innerNumber = null;
this.outer = null;

if ((this.endPositions.Count > 0) && (this.readBuffer.Position > this.EndPosition))
while ((this.endPositions.Count > 0) && (this.readBuffer.Position >= this.EndPosition))
{
throw CreateEmberException("Incorrect length at position {0}.", this.endPositions.Peek().LengthPosition);
}
if (this.readBuffer.Position > this.EndPosition)
{
throw CreateEmberException("Incorrect length at position {0}.", this.endPositions.Peek().LengthPosition);
}

while ((this.endPositions.Count > 0) && (this.readBuffer.Position == this.EndPosition))
{
var endPosition = this.endPositions.Pop();

if (IsContainer(endPosition))
Expand Down

0 comments on commit 001d5fa

Please sign in to comment.