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/byte_source.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/byte_source.c')
-rw-r--r-- | src/byte_source.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/byte_source.c b/src/byte_source.c index 397ea6d7..7a839875 100644 --- a/src/byte_source.c +++ b/src/byte_source.c @@ -8,6 +8,7 @@ #include "serd/node.h" #include "serd/string_view.h" +#include <assert.h> #include <stdbool.h> #include <stdint.h> #include <string.h> @@ -46,7 +47,10 @@ serd_byte_source_open_source(SerdByteSource* const source, const SerdNode* const name, const size_t page_size) { + assert(read_func); + assert(error_func); assert(page_size > 0); + memset(source, '\0', sizeof(*source)); source->read_func = read_func; source->error_func = error_func; |