diff options
Diffstat (limited to 'src/reader.h')
-rw-r--r-- | src/reader.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/reader.h b/src/reader.h index 7f5fe521..00a41794 100644 --- a/src/reader.h +++ b/src/reader.h @@ -146,15 +146,14 @@ push_byte(SerdReader* reader, SerdNode* node, const int c) { assert(c != EOF); - char* const s = (char*)serd_stack_push(&reader->stack, 1); - if (!s) { + if (reader->stack.size + 1 > reader->stack.buf_size) { return SERD_BAD_STACK; } - *(s - 1) = (char)c; - *s = '\0'; - + ((uint8_t*)reader->stack.buf)[reader->stack.size - 1] = (uint8_t)c; + ++reader->stack.size; ++node->length; + return SERD_SUCCESS; } |