diff options
author | David Robillard <d@drobilla.net> | 2017-08-28 12:42:50 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-08-28 12:43:18 +0200 |
commit | 91650728254f98e5949b28e3ad7bdac29047d2ae (patch) | |
tree | 087001506a78e952e33c3b3fefff8446d4b8233a /src | |
parent | 1cd321825c52eddd4175cb4ec58ae8d7ad2da48d (diff) | |
download | serd-91650728254f98e5949b28e3ad7bdac29047d2ae.tar.gz serd-91650728254f98e5949b28e3ad7bdac29047d2ae.tar.bz2 serd-91650728254f98e5949b28e3ad7bdac29047d2ae.zip |
Report errors for prematurely terminated statements
Diffstat (limited to 'src')
-rw-r--r-- | src/reader.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/reader.c b/src/reader.c index b224979b..f1b445b9 100644 --- a/src/reader.c +++ b/src/reader.c @@ -1599,7 +1599,7 @@ read_statement(SerdReader* reader) ReadContext ctx = { 0, 0, 0, 0, 0, 0, &flags }; Ref subj = 0; bool ate_dot = false; - char s_type = false; + char s_type = 0; bool ret = true; read_ws_star(reader); switch (peek_byte(reader)) { @@ -1641,7 +1641,9 @@ read_statement(SerdReader* reader) } else if (!subj) { ret = r_err(reader, SERD_ERR_BAD_SYNTAX, "bad subject\n"); } else if (!read_triples(reader, ctx, &ate_dot)) { - ret = (s_type == '['); + if (!(ret = (s_type == '['))) { + r_err(reader, SERD_ERR_BAD_SYNTAX, "expected predicate\n"); + } } else if (!ate_dot) { read_ws_star(reader); ret = (eat_byte_check(reader, '.') == '.'); |