From: Kevin McCarthy Date: Sun, 22 Sep 2019 22:58:58 +0000 (-0700) Subject: Convert compress setup_paths() to use buffer X-Git-Tag: 2019-10-25~23^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=10f308622c6d2cac5f04ac718c717cb1695323a0;p=neomutt Convert compress setup_paths() to use buffer Co-authored-by: Richard Russon --- diff --git a/compress.c b/compress.c index 6a28c2685..ded39fce3 100644 --- a/compress.c +++ b/compress.c @@ -134,14 +134,14 @@ static int setup_paths(struct Mailbox *m) if (!m) return -1; - char tmp[PATH_MAX]; - /* Setup the right paths */ mutt_str_replace(&m->realpath, mailbox_path(m)); /* We will uncompress to /tmp */ - mutt_mktemp(tmp, sizeof(tmp)); - mutt_buffer_strcpy(&m->pathbuf, tmp); + struct Buffer *buf = mutt_buffer_pool_get(); + mutt_buffer_mktemp(buf); + mutt_buffer_strcpy(&m->pathbuf, mutt_b2s(buf)); + mutt_buffer_pool_release(&buf); FILE *fp = mutt_file_fopen(mailbox_path(m), "w"); if (!fp)