aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/n3.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/n3.c b/src/n3.c
index f3112be0..bffc423b 100644
--- a/src/n3.c
+++ b/src/n3.c
@@ -943,12 +943,15 @@ read_literal(SerdReader* const reader,
break;
case '^':
eat_byte_safe(reader, '^');
- eat_byte_check(reader, '^');
+ if (!eat_byte_check(reader, '^')) {
+ return r_err(reader, SERD_ERR_BAD_SYNTAX, "expected `^'\n");
+ }
+
if ((st = read_iri(reader, datatype, ate_dot))) {
*datatype = pop_node(reader, *datatype);
*lang = pop_node(reader, *lang);
*dest = pop_node(reader, *dest);
- return r_err(reader, st, "bad literal\n");
+ return r_err(reader, st, "bad datatype\n");
}
break;
}