aboutsummaryrefslogtreecommitdiffstats
path: root/src/env.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-05-27 18:16:08 +0200
committerDavid Robillard <d@drobilla.net>2018-05-27 18:16:08 +0200
commita0c483d9f1f3955499560ef1536fdb760df274fb (patch)
treefa46603a7180e17a3d4e78ea088969d48babc79c /src/env.c
parent120b99b1cb02f153ec6f4071a8071ac08cb9d074 (diff)
downloadserd-a0c483d9f1f3955499560ef1536fdb760df274fb.tar.gz
serd-a0c483d9f1f3955499560ef1536fdb760df274fb.tar.bz2
serd-a0c483d9f1f3955499560ef1536fdb760df274fb.zip
Clarify errors returned by serd_env_expand()
Diffstat (limited to 'src/env.c')
-rw-r--r--src/env.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/env.c b/src/env.c
index adda27ba..d969d3df 100644
--- a/src/env.c
+++ b/src/env.c
@@ -215,8 +215,8 @@ serd_env_expand(const SerdEnv* env,
{
const uint8_t* const colon = (const uint8_t*)memchr(
curie->buf, ':', curie->n_bytes + 1);
- if (!colon) {
- return SERD_ERR_BAD_ARG; // Invalid CURIE
+ if (curie->type != SERD_CURIE || !colon) {
+ return SERD_ERR_BAD_ARG;
}
const size_t name_len = colon - curie->buf;
@@ -228,7 +228,7 @@ serd_env_expand(const SerdEnv* env,
uri_suffix->len = curie->n_bytes - (colon - curie->buf) - 1;
return SERD_SUCCESS;
}
- return SERD_ERR_NOT_FOUND;
+ return SERD_ERR_BAD_CURIE;
}
SERD_API