basic/strv: allow NULLs to be inserted into strv

All callers of this function insert non-empty strings, so there's no functional
change.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-01-22 16:23:24 -05:00
parent 58f88d929f
commit 18f71a3c81
1 changed files with 6 additions and 6 deletions

View File

@ -564,9 +564,6 @@ 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. */
@ -574,9 +571,12 @@ int strv_extend_front(char ***l, const char *value) {
if (m < n)
return -ENOMEM;
v = strdup(value);
if (!v)
return -ENOMEM;
if (value) {
v = strdup(value);
if (!v)
return -ENOMEM;
} else
v = NULL;
c = realloc_multiply(*l, sizeof(char*), m);
if (!c) {