From 86efa9e9c15efc166cf18a854f015578b726744c Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sun, 12 Feb 2023 16:16:25 +0100 Subject: [PATCH] mlmmj-send: use asprintf instead of reinventing it --- src/mlmmj-send.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/mlmmj-send.c b/src/mlmmj-send.c index c12b8616..bee0abfe 100644 --- a/src/mlmmj-send.c +++ b/src/mlmmj-send.c @@ -428,7 +428,7 @@ static void print_help(const char *prg) int main(int argc, char **argv) { - size_t len = 0, hdrslen, bodylen; + size_t hdrslen, bodylen; int sockfd = -1, mailfd = 0, opt, mindex = 0, subfd = 0, tmpfd; int deletewhensent = 1, sendres = 0, digest = 0; bool archive = true, ctrlarchive; @@ -634,10 +634,7 @@ int main(int argc, char **argv) /* initialize the archive filename */ if(archive) { mindex = incindexfile(ml.fd); - len = strlen(ml.dir) + 9 + 20; - archivefilename = xmalloc(len); - snprintf(archivefilename, len, "%s/archive/%d", ml.dir, - mindex); + xasprintf(&archivefilename, "%s/archive/%d", ml.dir, mindex); } if(!relayhost) -- 2.47.3