From: Mike Yuan Date: Mon, 10 Feb 2025 18:05:17 +0000 (+0100) Subject: string-util: drop now unused strnappend() X-Git-Tag: v258-rc1~1363^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=146b2ed6a661c6bd3023d06c57b04c01de35e008;p=thirdparty%2Fsystemd.git string-util: drop now unused strnappend() --- diff --git a/src/basic/string-util.c b/src/basic/string-util.c index dace8a606d5..196f3ff1a12 100644 --- a/src/basic/string-util.c +++ b/src/basic/string-util.c @@ -60,37 +60,6 @@ char* strprepend(char **x, const char *s) { return *x; } -char* strnappend(const char *s, const char *suffix, size_t b) { - size_t a; - char *r; - - if (!s && !suffix) - return strdup(""); - - if (!s) - return strndup(suffix, b); - - if (!suffix) - return strdup(s); - - assert(s); - assert(suffix); - - a = strlen(s); - if (b > SIZE_MAX - a) - return NULL; - - r = new(char, a+b+1); - if (!r) - return NULL; - - memcpy(r, s, a); - memcpy(r+a, suffix, b); - r[a+b] = 0; - - return r; -} - char* strstrip(char *s) { if (!s) return NULL; diff --git a/src/basic/string-util.h b/src/basic/string-util.h index 1b2f0970610..6a30193746f 100644 --- a/src/basic/string-util.h +++ b/src/basic/string-util.h @@ -108,8 +108,6 @@ char* first_word(const char *s, const char *word) _pure_; char* strprepend(char **x, const char *s); -char* strnappend(const char *s, const char *suffix, size_t length); - #define strjoin(a, ...) strextend_with_separator_internal(NULL, NULL, a, __VA_ARGS__, NULL) #define strjoina(a, ...) \