mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 17:06:39 +09: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