diff options
Diffstat (limited to 'src/uri.c')
-rw-r--r-- | src/uri.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -19,6 +19,7 @@ #include "serd/serd.h" +#include <assert.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> @@ -27,6 +28,8 @@ char* serd_parse_file_uri(const char* const uri, char** const hostname) { + assert(uri); + const char* path = uri; if (hostname) { *hostname = NULL; @@ -79,6 +82,8 @@ serd_parse_file_uri(const char* const uri, char** const hostname) bool serd_uri_string_has_scheme(const char* const string) { + assert(string); + if (is_alpha(string[0])) { for (size_t i = 1; string[i]; ++i) { if (!is_uri_scheme_char(string[i])) { @@ -97,6 +102,8 @@ serd_uri_string_has_scheme(const char* const string) SerdURIView serd_parse_uri(const char* const string) { + assert(string); + SerdURIView result = SERD_URI_NULL; const char* ptr = string; @@ -453,6 +460,9 @@ serd_write_uri(const SerdURIView uri, const SerdWriteFunc sink, void* const stream) { + assert(sink); + assert(stream); + size_t len = 0; if (uri.scheme.buf) { |