Use evbuffer for building S, W, L lists, also add an xmemdup helper

instead of misusing asprintf.
This commit is contained in:
nicm
2026-06-18 10:56:22 +00:00
parent d92a479d2f
commit 0a6c846091
3 changed files with 64 additions and 35 deletions

View File

@@ -105,6 +105,18 @@ xstrndup(const char *str, size_t maxlen)
return cp;
}
char *
xmemdup(const void *ptr, size_t len)
{
char *cp;
cp = xmalloc(len + 1);
if (len != 0)
memcpy(cp, ptr, len);
cp[len] = '\0';
return cp;
}
int
xasprintf(char **ret, const char *fmt, ...)
{