]> granicus.if.org Git - neomutt/commitdiff
Convert attach_fmt %f to use buffer pool
authorKevin McCarthy <kevin@8t8.us>
Wed, 23 Oct 2019 06:44:47 +0000 (14:44 +0800)
committerRichard Russon <rich@flatcap.org>
Sat, 26 Oct 2019 22:55:44 +0000 (23:55 +0100)
Upstream-commit: https://gitlab.com/muttmua/mutt/commit/1f71fad9bb2d0b6d8f75f24d55576e52f7c108c0
Co-authored-by: Richard Russon <rich@flatcap.org>
recvattach.c

index 4fc394dad8dd0404faf355effd1989b57d50b94b..9301bfe6c1641d9483054c82e41135dd7fdc7dbc 100644 (file)
@@ -300,11 +300,12 @@ const char *attach_format_str(char *buf, size_t buflen, size_t col, int cols,
       {
         if (aptr->content->filename && (*aptr->content->filename == '/'))
         {
-          char path[PATH_MAX];
+          struct Buffer *path = mutt_buffer_pool_get();
 
-          mutt_str_strfcpy(path, aptr->content->filename, sizeof(path));
-          mutt_pretty_mailbox(path, sizeof(path));
-          mutt_format_s(buf, buflen, prec, path);
+          mutt_buffer_strcpy(path, aptr->content->filename);
+          mutt_buffer_pretty_mailbox(path);
+          mutt_format_s(buf, buflen, prec, mutt_b2s(path));
+          mutt_buffer_pool_release(&path);
         }
         else
           mutt_format_s(buf, buflen, prec, NONULL(aptr->content->filename));