aboutsummaryrefslogtreecommitdiffstats
path: root/src/reader.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-11-24 16:40:51 -0500
committerDavid Robillard <d@drobilla.net>2022-11-25 07:05:56 -0500
commitd40a7fe79847ab46e544d9fbb845affbe876c0db (patch)
treeee33ce36010a31faf7915f1b1a5cfdc60d660b27 /src/reader.c
parentf2ea3154a742238f0b9943bb58efd0627ffda3e8 (diff)
downloadserd-d40a7fe79847ab46e544d9fbb845affbe876c0db.tar.gz
serd-d40a7fe79847ab46e544d9fbb845affbe876c0db.tar.bz2
serd-d40a7fe79847ab46e544d9fbb845affbe876c0db.zip
Always handle the return value of eat_byte_safe()
Diffstat (limited to 'src/reader.c')
-rw-r--r--src/reader.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/reader.c b/src/reader.c
index 85e23e6a..113c3e57 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -294,8 +294,8 @@ static SerdStatus
skip_bom(SerdReader* const me)
{
if (serd_byte_source_peek(&me->source) == 0xEF) {
- serd_byte_source_advance(&me->source);
- if (serd_byte_source_peek(&me->source) != 0xBB ||
+ if (serd_byte_source_advance(&me->source) ||
+ serd_byte_source_peek(&me->source) != 0xBB ||
serd_byte_source_advance(&me->source) ||
serd_byte_source_peek(&me->source) != 0xBF ||
serd_byte_source_advance(&me->source)) {
@@ -360,7 +360,7 @@ serd_reader_read_chunk(SerdReader* const reader)
if (peek_byte(reader) == 0) {
// Skip leading null byte, for reading from a null-delimited socket
- eat_byte_safe(reader, 0);
+ st = skip_byte(reader, 0);
}
return st ? st : read_statement(reader);