aboutsummaryrefslogtreecommitdiffstats
path: root/src/uri.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/uri.c')
-rw-r--r--src/uri.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/uri.c b/src/uri.c
index c66e28d7..1862c280 100644
--- a/src/uri.c
+++ b/src/uri.c
@@ -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) {