From e7d3bca4d7021f9796b3a317e4eaf79e09a1cc4e Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Thu, 5 Feb 2026 04:29:07 +0000 Subject: [PATCH] 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. --- src/stream.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/stream.c b/src/stream.c index b29b49c..e03c5ef 100644 --- a/src/stream.c +++ b/src/stream.c @@ -192,10 +192,9 @@ bool stream_chunk(stream_t *stream) char stream_next(stream_t *stream) { - char c = stream_peek(stream); - if (c != '\0') + if (stream_peek(stream) != '\0') ++stream->position; - return c; + return stream_peek(stream); } char stream_peek(stream_t *stream)