]> granicus.if.org Git - neomutt/commitdiff
Convert mutt_num_postponed() maildir check to use buffer pool
authorKevin McCarthy <kevin@8t8.us>
Wed, 23 Oct 2019 06:33:09 +0000 (14:33 +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/80bc61db364b4e031a9789ce8c79a5f083fc8652
Co-authored-by: Richard Russon <rich@flatcap.org>
postpone.c

index e1bda7a07908148be824b5d994125aa7a87aa55e..aac3534872bcc88b840346f745b86401369de722 100644 (file)
@@ -146,16 +146,17 @@ int mutt_num_postponed(struct Mailbox *m, bool force)
   if (S_ISDIR(st.st_mode))
   {
     /* if we have a maildir mailbox, we need to stat the "new" dir */
+    struct Buffer *buf = mutt_buffer_pool_get();
 
-    char buf[PATH_MAX];
-
-    snprintf(buf, sizeof(buf), "%s/new", C_Postponed);
-    if ((access(buf, F_OK) == 0) && (stat(buf, &st) == -1))
+    mutt_buffer_printf(buf, "%s/new", C_Postponed);
+    if ((access(mutt_b2s(buf), F_OK) == 0) && (stat(mutt_b2s(buf), &st) == -1))
     {
       PostCount = 0;
       LastModify = 0;
+      mutt_buffer_pool_release(&buf);
       return 0;
     }
+    mutt_buffer_pool_release(&buf);
   }
 
   if (LastModify < st.st_mtime)