aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/serdi.c2
-rw-r--r--src/writer.c8
-rw-r--r--wscript2
3 files changed, 7 insertions, 5 deletions
diff --git a/src/serdi.c b/src/serdi.c
index 7a275e36..e85c9f70 100644
--- a/src/serdi.c
+++ b/src/serdi.c
@@ -204,7 +204,7 @@ main(int argc, char** argv)
input += 5;
}
}
- in_fd = fopen((const char*)input, "r");
+ in_fd = fopen((const char*)input, "r");
if (!in_fd) {
fprintf(stderr, "failed to open file %s\n", input);
return 1;
diff --git a/src/writer.c b/src/writer.c
index 9ba02489..dd1d3f7a 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -207,10 +207,10 @@ write_node(SerdWriter writer,
writer->sink("\"", 1, writer->stream);
write_text(writer, WRITE_STRING, node->buf, node->n_bytes - 1, '"');
writer->sink("\"", 1, writer->stream);
- if (lang->buf) {
+ if (lang && lang->buf) {
writer->sink("@", 1, writer->stream);
writer->sink(lang->buf, lang->n_bytes - 1, writer->stream);
- } else if (datatype->buf) {
+ } else if (datatype && datatype->buf) {
writer->sink("^^", 2, writer->stream);
write_node(writer, datatype, NULL, NULL);
}
@@ -316,7 +316,9 @@ serd_writer_write_statement(SerdWriter writer,
write_node(writer, object, object_datatype, object_lang);
}
- const WriteContext new_context = { *graph, *subject, *predicate };
+ const WriteContext new_context = { graph ? *graph : SERD_NODE_NULL,
+ *subject,
+ *predicate };
writer->context = new_context;
return true;
}
diff --git a/wscript b/wscript
index 9dbe5b74..f5f95c99 100644
--- a/wscript
+++ b/wscript
@@ -47,7 +47,7 @@ def configure(conf):
autowaf.define(conf, 'SERD_VERSION', SERD_VERSION)
conf.write_config_header('serd-config.h', remove=False)
- autowaf.display_msg(conf, "Utilities", str(conf.env['BUILD_UTILS'] == 1))
+ autowaf.display_msg(conf, "Utilities", str(conf.env['BUILD_UTILS']))
autowaf.display_msg(conf, "Unit tests", str(conf.env['BUILD_TESTS']))
print