aboutsummaryrefslogtreecommitdiffstats
path: root/src/n3.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-05-13 00:48:31 +0200
committerDavid Robillard <d@drobilla.net>2018-11-25 22:12:47 +0100
commit9c5e41683fc2da0ba4089c728992f481e9908bf2 (patch)
tree77a70acd7b107029ba5131a4d401fadf28b0f2a8 /src/n3.c
parent7698e111ce687c6ba80590d66f9f4c0487783004 (diff)
downloadserd-9c5e41683fc2da0ba4089c728992f481e9908bf2.tar.gz
serd-9c5e41683fc2da0ba4089c728992f481e9908bf2.tar.bz2
serd-9c5e41683fc2da0ba4089c728992f481e9908bf2.zip
Zero node padding before passing to reader sinks
Diffstat (limited to 'src/n3.c')
-rw-r--r--src/n3.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/n3.c b/src/n3.c
index 75160f2d..821d1ebc 100644
--- a/src/n3.c
+++ b/src/n3.c
@@ -1054,10 +1054,10 @@ read_object(SerdReader* reader, ReadContext* ctx, bool emit, bool* ate_dot)
o->flags = flags;
}
- if (ret && emit && simple) {
+ if (ret && emit && simple && o) {
ret = emit_statement(reader, *ctx, o);
} else if (ret && !emit) {
- ctx->object = o;
+ ctx->object = o;
return true;
}
@@ -1265,6 +1265,7 @@ read_base(SerdReader* reader, bool sparql, bool token)
if (!uri) {
return false;
} else if (reader->sink->base) {
+ serd_node_zero_pad(uri);
reader->sink->base(reader->sink->handle, uri);
}
@@ -1299,12 +1300,14 @@ read_prefixID(SerdReader* reader, bool sparql, bool token)
}
read_ws_star(reader);
- const SerdNode* uri = read_IRIREF(reader);
+ SerdNode* uri = read_IRIREF(reader);
if (!uri) {
return false;
}
if (reader->sink->prefix) {
+ serd_node_zero_pad(name);
+ serd_node_zero_pad(uri);
ret = !reader->sink->prefix(reader->sink->handle, name, uri);
}
if (!sparql) {