diff options
author | David Robillard <d@drobilla.net> | 2022-10-02 14:47:14 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 18:49:07 -0500 |
commit | aa6b5ec5b9344bce0ea38d294aef0782c3745548 (patch) | |
tree | 0481c7a3b690a35728b0649d281e0ba3e321a428 /src/env.c | |
parent | 6076b31090176be685c30aa198edd3cebfd4fd7a (diff) | |
download | serd-aa6b5ec5b9344bce0ea38d294aef0782c3745548.tar.gz serd-aa6b5ec5b9344bce0ea38d294aef0782c3745548.tar.bz2 serd-aa6b5ec5b9344bce0ea38d294aef0782c3745548.zip |
Add assertions for all non-null pointers in the public API
Diffstat (limited to 'src/env.c')
-rw-r--r-- | src/env.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -115,6 +115,8 @@ serd_env_base_uri(const SerdEnv* const env) SerdStatus serd_env_set_base_uri(SerdEnv* const env, const SerdStringView uri) { + assert(env); + if (!uri.length) { serd_node_free(env->base_uri_node); env->base_uri_node = NULL; @@ -179,6 +181,8 @@ serd_env_set_prefix(SerdEnv* const env, const SerdStringView name, const SerdStringView uri) { + assert(env); + if (serd_uri_string_has_scheme(uri.data)) { // Set prefix to absolute URI serd_env_add(env, name, uri); @@ -323,6 +327,9 @@ serd_env_expand(const SerdEnv* env, const SerdNode* node) SerdStatus serd_env_write_prefixes(const SerdEnv* const env, const SerdSink* const sink) { + assert(env); + assert(sink); + SerdStatus st = SERD_SUCCESS; for (size_t i = 0; !st && i < env->n_prefixes; ++i) { |