1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00

strv: use STRV_FOREACH() at two more places

This commit is contained in:
Yu Watanabe 2022-03-16 22:30:13 +09:00 committed by Lennart Poettering
parent 9eb814818d
commit d0b4f13ef8

View File

@ -70,10 +70,9 @@ char* strv_find_startswith(char * const *l, const char *name) {
}
char** strv_free(char **l) {
if (!l)
return NULL;
char **k;
for (char **k = l; *k; k++)
STRV_FOREACH(k, l)
free(*k);
return mfree(l);
@ -109,12 +108,10 @@ char** strv_copy(char * const *l) {
}
size_t strv_length(char * const *l) {
char * const *i;
size_t n = 0;
if (!l)
return 0;
for (; *l; l++)
STRV_FOREACH(i, l)
n++;
return n;