summaryrefslogtreecommitdiffstats
path: root/src/dumper.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-03-12 18:44:31 -0500
committerDavid Robillard <d@drobilla.net>2022-03-12 18:44:31 -0500
commitd06e9cb31e3f3b522b21541353c915a663e0f814 (patch)
tree3f3d66fa599a06e1b85339ca46d12d63b639d777 /src/dumper.c
parent38181cbf7283593be2ef7bf4be890986b6a32b86 (diff)
downloadsratom-d06e9cb31e3f3b522b21541353c915a663e0f814.tar.gz
sratom-d06e9cb31e3f3b522b21541353c915a663e0f814.tar.bz2
sratom-d06e9cb31e3f3b522b21541353c915a663e0f814.zip
fixup! port to serd1
Diffstat (limited to 'src/dumper.c')
-rw-r--r--src/dumper.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dumper.c b/src/dumper.c
index b577dff..49878d1 100644
--- a/src/dumper.c
+++ b/src/dumper.c
@@ -23,6 +23,7 @@
#include "lv2/urid/urid.h"
#include "serd/serd.h"
+#include <assert.h>
#include <ctype.h>
#include <stdbool.h>
#include <stdint.h>
@@ -30,6 +31,8 @@
#include <stdlib.h>
#include <string.h>
+// IWYU pragma: no_forward_declare SratomDumperImpl
+
#define NS_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
#define NS_XSD "http://www.w3.org/2001/XMLSchema#"
@@ -321,7 +324,8 @@ write_atom(StreamContext* const ctx,
char* const str = (char*)calloc(len + 1, 1);
for (uint32_t i = 0; i < size; ++i) {
snprintf(str + (2 * i),
- size * 2 + 1,
+ size - (2 * i),
+ /* 3, */
"%02X",
(unsigned)*((const uint8_t*)body + i));
}
@@ -457,6 +461,7 @@ write_atom(StreamContext* const ctx,
if (object) {
if (!subject || !predicate) {
const SerdNode* const blank = serd_world_get_blank(writer->world);
+ assert(writer->nodes.rdf_first);
serd_sink_write(sink,
ctx->sflags | SERD_LIST_S | SERD_TERSE_S,
blank,