aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2020-03-26 10:36:49 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2020-03-26 10:36:49 -0400
commit1b63c1503bddfd8f48e7ca4e97b029d7ad030635 (patch)
treed13bde56de457b3b8bf70c94abc8125442822168
parent37ec63ece45c7f27f576e1fb5911b55630125d03 (diff)
downloadspmc-1b63c1503bddfd8f48e7ca4e97b029d7ad030635.tar.gz
Guarantee the array is terminated
-rw-r--r--lib/str.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/str.c b/lib/str.c
index 0e2f90e..55e1c79 100644
--- a/lib/str.c
+++ b/lib/str.c
@@ -206,6 +206,7 @@ char** split(char *_sptr, const char* delim)
// No delimiter, but the string was not NULL, so return the original string
if (split_alloc == 0) {
result[0] = sptr;
+ result[1] = NULL;
return result;
}