Merge pull request #14617 from poettering/no-strv-clear
strv: remove strv_clear() and some other minor fixes
This commit is contained in:
+2
-7
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user