stream: fix bug with stream_next; return the next character
It seems we'd return the previously peeked character when stream_next'ing, when really we should be sending the updated character.
This commit is contained in:
@@ -192,10 +192,9 @@ bool stream_chunk(stream_t *stream)
|
|||||||
|
|
||||||
char stream_next(stream_t *stream)
|
char stream_next(stream_t *stream)
|
||||||
{
|
{
|
||||||
char c = stream_peek(stream);
|
if (stream_peek(stream) != '\0')
|
||||||
if (c != '\0')
|
|
||||||
++stream->position;
|
++stream->position;
|
||||||
return c;
|
return stream_peek(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
char stream_peek(stream_t *stream)
|
char stream_peek(stream_t *stream)
|
||||||
|
|||||||
Reference in New Issue
Block a user