Merge pull request #14617 from poettering/no-strv-clear

strv: remove strv_clear() and some other minor fixes
This commit is contained in:
Lennart Poettering
2020-01-21 15:08:38 +01:00
committed by GitHub
3 changed files with 16 additions and 35 deletions
+2 -7
View File
@@ -57,20 +57,15 @@ char *strv_find_startswith(char * const *l, const char *name) {
return NULL;
}
void strv_clear(char **l) {
char **strv_free(char **l) {
char **k;
if (!l)
return;
return NULL;
for (k = l; *k; k++)
free(*k);
*l = NULL;
}
char **strv_free(char **l) {
strv_clear(l);
return mfree(l);
}
-2
View File
@@ -25,8 +25,6 @@ char **strv_free_erase(char **l);
DEFINE_TRIVIAL_CLEANUP_FUNC(char**, strv_free_erase);
#define _cleanup_strv_free_erase_ _cleanup_(strv_free_erasep)
void strv_clear(char **l);
char **strv_copy(char * const *l);
size_t strv_length(char * const *l) _pure_;