aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/strings.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/strings.c b/src/strings.c
index 95068d0..0dc9c47 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -149,6 +149,9 @@ void strdelsuffix(char *sptr, const char *suffix) {
*/
char** split(char *_sptr, const char* delim)
{
+ if (_sptr == NULL) {
+ return NULL;
+ }
size_t split_alloc = 0;
// Duplicate the input string and save a copy of the pointer to be freed later
char *orig = strdup(_sptr);