diff options
author | David Robillard <d@drobilla.net> | 2020-08-15 14:58:18 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-08-15 22:52:05 +0200 |
commit | 6bd9bdffe2a06645c4a6ce84a45855fe072aeabd (patch) | |
tree | d9347101f60bf1e326b8252742b352b39baa696e /src/n3.c | |
parent | 64f8675d5a18828494c53579f11ff443b41fda6e (diff) | |
download | serd-6bd9bdffe2a06645c4a6ce84a45855fe072aeabd.tar.gz serd-6bd9bdffe2a06645c4a6ce84a45855fe072aeabd.tar.bz2 serd-6bd9bdffe2a06645c4a6ce84a45855fe072aeabd.zip |
Make read_PERCENT() return a status
Diffstat (limited to 'src/n3.c')
-rw-r--r-- | src/n3.c | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -481,7 +481,7 @@ read_PN_CHARS(SerdReader* reader, Ref dest) return st; } -static bool +static SerdStatus read_PERCENT(SerdReader* reader, Ref dest) { push_byte(reader, dest, eat_byte_safe(reader, '%')); @@ -489,10 +489,9 @@ read_PERCENT(SerdReader* reader, Ref dest) const uint8_t h2 = read_HEX(reader); if (h1 && h2) { push_byte(reader, dest, h1); - push_byte(reader, dest, h2); - return true; + return push_byte(reader, dest, h2); } - return false; + return SERD_ERR_BAD_SYNTAX; } static SerdStatus @@ -538,10 +537,7 @@ read_PLX(SerdReader* reader, Ref dest) const int c = peek_byte(reader); switch (c) { case '%': - if (!read_PERCENT(reader, dest)) { - return SERD_ERR_BAD_SYNTAX; - } - return SERD_SUCCESS; + return read_PERCENT(reader, dest); case '\\': return read_PN_LOCAL_ESC(reader, dest); default: |