aboutsummaryrefslogtreecommitdiffstats
path: root/src/byte_source.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/byte_source.c')
-rw-r--r--src/byte_source.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/byte_source.c b/src/byte_source.c
index ef6bf3bb..c0cb6413 100644
--- a/src/byte_source.c
+++ b/src/byte_source.c
@@ -28,6 +28,7 @@
# include <fcntl.h>
#endif
+#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
@@ -67,6 +68,9 @@ serd_byte_source_new_function(const SerdReadFunc read_func,
const SerdNode* const name,
const size_t page_size)
{
+ assert(read_func);
+ assert(error_func);
+
if (!page_size) {
return NULL;
}
@@ -114,6 +118,8 @@ is_directory(const char* const path)
SerdByteSource*
serd_byte_source_new_filename(const char* const path, const size_t page_size)
{
+ assert(path);
+
if (page_size == 0 || is_directory(path)) {
return NULL;
}
@@ -158,6 +164,8 @@ SerdByteSource*
serd_byte_source_new_string(const char* const string,
const SerdNode* const name)
{
+ assert(string);
+
SerdByteSource* source = (SerdByteSource*)calloc(1, sizeof(SerdByteSource));
source->page_size = 1;