string-util: drop now unused strnappend()

This commit is contained in:
Mike Yuan
2025-02-10 19:39:22 +01:00
parent ea5fbc3938
commit 146b2ed6a6
2 changed files with 0 additions and 33 deletions
-31
View File
@@ -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;