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 3d560c98..1e641be8 100644
--- a/src/env.c
+++ b/src/env.c
@@ -231,12 +231,10 @@ serd_env_expand_node(const SerdEnv* const env, const SerdNode* const 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;
@@ -245,16 +243,13 @@ serd_env_expand_node(const SerdEnv* const env, const SerdNode* const 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;
}