mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-10 01:17:44 +03:00
Revert "basic/strv: allow NULLs to be inserted into strv"
This reverts commit18f71a3c81
. According to @keszybz we don't need this anymore, hence drop it:18f71a3c81 (r102232368)
This commit is contained in:
parent
48a601fe5d
commit
bcab914f7f
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user