summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-02-21 18:11:12 +0100
committerLennart Poettering <lennart@poettering.net>2017-02-21 21:55:44 +0100
commitbcab914f7fb0570eb728907163ada55c6ae3d602 (patch)
tree676c5bd2a479a80cbce71ba02c1ada8883989540 /src
parent48a601fe5de8aa0d89ba6dadde168769fa7ce992 (diff)
Revert "basic/strv: allow NULLs to be inserted into strv"
This reverts commit 18f71a3c8174774c5386c4aba94d54f3b5c36a84. According to @keszybz we don't need this anymore, hence drop it: https://github.com/systemd/systemd/pull/5131/commits/18f71a3c8174774c5386c4aba94d54f3b5c36a84#r102232368
Diffstat (limited to 'src')
-rw-r--r--src/basic/strv.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/basic/strv.c b/src/basic/strv.c
index 60f92e6373..0eec868eed 100644
--- a/src/basic/strv.c
+++ b/src/basic/strv.c
@@ -564,6 +564,9 @@ int strv_extend_front(char ***l, const char *value) {
/* Like strv_extend(), but prepends rather than appends the new entry */
+ if (!value)
+ return 0;
+
n = strv_length(*l);
/* Increase and overflow check. */
@@ -571,12 +574,9 @@ int strv_extend_front(char ***l, const char *value) {
if (m < n)
return -ENOMEM;
- if (value) {
- v = strdup(value);
- if (!v)
- return -ENOMEM;
- } else
- v = NULL;
+ v = strdup(value);
+ if (!v)
+ return -ENOMEM;
c = realloc_multiply(*l, sizeof(char*), m);
if (!c) {