aboutsummaryrefslogtreecommitdiffstats
path: root/src/byte_source.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-03-28 10:20:46 -0400
committerDavid Robillard <d@drobilla.net>2024-03-28 10:20:46 -0400
commit6aed064084c8c1af02adb46b0066aaee1f436edf (patch)
treed618dc61fe9d2ed60f592e83b33753029eb91441 /src/byte_source.c
parenta3051f0fbe9b76bb91498d62647dad1d27b43691 (diff)
downloadserd-6aed064084c8c1af02adb46b0066aaee1f436edf.tar.gz
serd-6aed064084c8c1af02adb46b0066aaee1f436edf.tar.bz2
serd-6aed064084c8c1af02adb46b0066aaee1f436edf.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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/byte_source.c b/src/byte_source.c
index 7c191745..5443f4dd 100644
--- a/src/byte_source.c
+++ b/src/byte_source.c
@@ -7,6 +7,7 @@
#include "serd/serd.h"
+#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
@@ -43,6 +44,10 @@ serd_byte_source_open_source(SerdByteSource* const source,
{
const Cursor cur = {name, 1, 1};
+ assert(read_func);
+ assert(error_func);
+ assert(page_size > 0);
+
memset(source, '\0', sizeof(*source));
source->stream = stream;
source->from_stream = true;