mirror of
https://github.com/systemd/systemd.git
synced 2026-07-12 10:34:12 +00:00
strv: introduce strv_free_and_replace()
it's like free_and_replace() but uses strv_free()
This commit is contained in:
@@ -181,3 +181,11 @@ char **strv_skip(char **l, size_t n);
|
||||
int strv_extend_n(char ***l, const char *value, size_t n);
|
||||
|
||||
int fputstrv(FILE *f, char **l, const char *separator, bool *space);
|
||||
|
||||
#define strv_free_and_replace(a, b) \
|
||||
({ \
|
||||
strv_free(a); \
|
||||
(a) = (b); \
|
||||
(b) = NULL; \
|
||||
0; \
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user