diff options
author | David Robillard <d@drobilla.net> | 2016-03-15 23:37:09 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 16:27:02 -0500 |
commit | d107eb486f24c0e68eff4e1b622850fca5f75d77 (patch) | |
tree | d8c2678be2739467005f5807f331ad4bcfa9790a /src/env.c | |
parent | 1c59b863d8c2c2d7b5531866586baf232c0047a2 (diff) | |
download | serd-d107eb486f24c0e68eff4e1b622850fca5f75d77.tar.gz serd-d107eb486f24c0e68eff4e1b622850fca5f75d77.tar.bz2 serd-d107eb486f24c0e68eff4e1b622850fca5f75d77.zip |
Remove useless character counting
Diffstat (limited to 'src/env.c')
-rw-r--r-- | src/env.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -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; } |