aboutsummaryrefslogtreecommitdiffstats
path: root/src/env.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/env.c')
-rw-r--r--src/env.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/env.c b/src/env.c
index 67fa9caf..05274df6 100644
--- a/src/env.c
+++ b/src/env.c
@@ -220,12 +220,10 @@ serd_env_expand_node(const SerdEnv* env, const SerdNode* node)
case SERD_NOTHING:
case SERD_LITERAL:
break;
-
case SERD_URI: {
SerdURI ignored;
return serd_node_new_uri_from_node(node, &env->base_uri, &ignored);
}
-
case SERD_CURIE: {
SerdChunk prefix;
SerdChunk suffix;
@@ -234,16 +232,13 @@ serd_env_expand_node(const SerdEnv* env, const SerdNode* node)
}
const size_t len = prefix.len + suffix.len;
uint8_t* buf = (uint8_t*)malloc(len + 1);
- SerdNode ret = {buf, len, 0, 0, SERD_URI};
- snprintf((char*)buf, len + 1, "%s%s", prefix.buf, suffix.buf);
- ret.n_chars = serd_strlen(buf, NULL, NULL);
+ SerdNode ret = {buf, len, 0, SERD_URI};
+ snprintf((char*)buf, ret.n_bytes + 1, "%s%s", prefix.buf, suffix.buf);
return ret;
}
-
case SERD_BLANK:
break;
}
-
return SERD_NODE_NULL;
}