]> granicus.if.org Git - neomutt/commitdiff
Convert compress setup_paths() to use buffer
authorKevin McCarthy <kevin@8t8.us>
Sun, 22 Sep 2019 22:58:58 +0000 (15:58 -0700)
committerRichard Russon <rich@flatcap.org>
Tue, 1 Oct 2019 10:25:08 +0000 (11:25 +0100)
Co-authored-by: Richard Russon <rich@flatcap.org>
compress.c

index 6a28c2685bebc4866dde80b4bbceaad44f1bb79f..ded39fce32ce9b83c4271e7ad293a33b211957b9 100644 (file)
@@ -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)