mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 16:37:19 +09:00
string-util: modernize strextendn() a bit
l == SIZE_MAX requires no special handling, since we assert on (s || l == 0) above.
This commit is contained in:
@@ -107,6 +107,7 @@ static inline const char* empty_or_dash_to_null(const char *p) {
|
||||
char* first_word(const char *s, const char *word) _pure_;
|
||||
|
||||
char* strprepend(char **x, const char *s);
|
||||
char* strextendn(char **x, const char *s, size_t l);
|
||||
|
||||
#define strjoin(a, ...) strextend_with_separator_internal(NULL, NULL, a, __VA_ARGS__, NULL)
|
||||
|
||||
@@ -193,8 +194,6 @@ char* strextend_with_separator_internal(char **x, const char *separator, ...) _s
|
||||
#define strextend_with_separator(x, separator, ...) strextend_with_separator_internal(x, separator, __VA_ARGS__, NULL)
|
||||
#define strextend(x, ...) strextend_with_separator_internal(x, NULL, __VA_ARGS__, NULL)
|
||||
|
||||
char* strextendn(char **x, const char *s, size_t l);
|
||||
|
||||
int strextendf_with_separator(char **x, const char *separator, const char *format, ...) _printf_(3,4);
|
||||
#define strextendf(x, ...) strextendf_with_separator(x, NULL, __VA_ARGS__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user