diff options
author | David Robillard <d@drobilla.net> | 2024-06-09 18:21:21 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-06-09 18:21:56 -0400 |
commit | c57e92c6eeb715f0caa6c4799a7a1e54e49fc62f (patch) | |
tree | dd1fd991014e72595378d524e4921a808e74a0d5 /src/n3.c | |
parent | 8f94d1b38df369c9316b499bf9434cf89c825098 (diff) | |
download | serd-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |