diff options
-rw-r--r-- | src/n3.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -610,26 +610,27 @@ read_PN_PREFIX(SerdReader* reader, SerdNode* dest) } static SerdStatus -read_LANGTAG(SerdReader* reader, SerdNode** dest) +read_LANGTAG(SerdReader* reader) { int c = peek_byte(reader); if (!is_alpha(c)) { return r_err(reader, SERD_ERR_BAD_SYNTAX, "unexpected `%c'\n", c); } - if (!(*dest = push_node(reader, SERD_LITERAL, "", 0))) { + SerdNode* node = push_node(reader, SERD_LITERAL, "", 0); + if (!node) { return SERD_ERR_OVERFLOW; } SerdStatus st = SERD_SUCCESS; - TRY(st, push_byte(reader, *dest, eat_byte_safe(reader, c))); + TRY(st, push_byte(reader, node, eat_byte_safe(reader, c))); while ((c = peek_byte(reader)) && is_alpha(c)) { - TRY(st, push_byte(reader, *dest, eat_byte_safe(reader, c))); + TRY(st, push_byte(reader, node, eat_byte_safe(reader, c))); } while (peek_byte(reader) == '-') { - TRY(st, push_byte(reader, *dest, eat_byte_safe(reader, '-'))); + TRY(st, push_byte(reader, node, eat_byte_safe(reader, '-'))); while ((c = peek_byte(reader)) && (is_alpha(c) || is_digit(c))) { - TRY(st, push_byte(reader, *dest, eat_byte_safe(reader, c))); + TRY(st, push_byte(reader, node, eat_byte_safe(reader, c))); } } return SERD_SUCCESS; @@ -849,12 +850,11 @@ read_literal(SerdReader* reader, SerdNode** dest, bool* ate_dot) } SerdNode* datatype = NULL; - SerdNode* lang = NULL; switch (peek_byte(reader)) { case '@': eat_byte_safe(reader, '@'); (*dest)->flags |= SERD_HAS_LANGUAGE; - if ((st = read_LANGTAG(reader, &lang))) { + if ((st = read_LANGTAG(reader))) { return r_err(reader, st, "bad literal\n"); } break; |