aboutsummaryrefslogtreecommitdiffstats
path: root/src/string.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/string.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/string.c')
-rw-r--r--src/string.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/string.c b/src/string.c
index ecba3463..52fb4a91 100644
--- a/src/string.c
+++ b/src/string.c
@@ -5,6 +5,7 @@
#include "serd/serd.h"
+#include <assert.h>
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
@@ -131,6 +132,8 @@ read_sign(const char** const sptr)
double
serd_strtod(const char* const str, char** const endptr)
{
+ assert(str);
+
double result = 0.0;
// Point s at the first non-whitespace character