aboutsummaryrefslogtreecommitdiffstats
path: root/src/n3.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-06-09 18:21:21 -0400
committerDavid Robillard <d@drobilla.net>2024-06-09 18:21:56 -0400
commitc57e92c6eeb715f0caa6c4799a7a1e54e49fc62f (patch)
treedd1fd991014e72595378d524e4921a808e74a0d5 /src/n3.c
parent8f94d1b38df369c9316b499bf9434cf89c825098 (diff)
downloadserd-c57e92c6eeb715f0caa6c4799a7a1e54e49fc62f.tar.gz
serd-c57e92c6eeb715f0caa6c4799a7a1e54e49fc62f.tar.bz2
serd-c57e92c6eeb715f0caa6c4799a7a1e54e49fc62f.zip
Treat out of range unicode characters as errors
Diffstat (limited to 'src/n3.c')
-rw-r--r--src/n3.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/n3.c b/src/n3.c
index 6684fae8..39b00d13 100644
--- a/src/n3.c
+++ b/src/n3.c
@@ -97,7 +97,7 @@ read_UCHAR(SerdReader* const reader, const Ref dest, uint32_t* const char_code)
code);
push_bytes(reader, dest, replacement_char, 3);
*char_code = 0xFFFD;
- return SERD_SUCCESS;
+ return reader->strict ? SERD_ERR_BAD_SYNTAX : SERD_SUCCESS;
}
// Build output in buf
@@ -325,7 +325,7 @@ read_string_escape(SerdReader* const reader,
uint32_t code = 0;
if ((st = read_ECHAR(reader, ref, flags)) &&
(st = read_UCHAR(reader, ref, &code))) {
- return r_err(reader, st, "invalid escape '\\%c'\n", peek_byte(reader));
+ return r_err(reader, st, "expected string escape sequence\n");
}
return st;