diff options
-rw-r--r-- | src/byte_source.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/byte_source.h b/src/byte_source.h index 02aab663..bd6701c9 100644 --- a/src/byte_source.h +++ b/src/byte_source.h @@ -69,10 +69,11 @@ serd_byte_source_advance(SerdByteSource* source) { SerdStatus st = SERD_SUCCESS; - if (serd_byte_source_peek(source) == '\n') { + const uint8_t c = serd_byte_source_peek(source); + if (c == '\n') { ++source->cur.line; source->cur.col = 0; - } else { + } else if (c) { ++source->cur.col; } |