]> granicus.if.org Git - mutt/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)
committerKevin McCarthy <kevin@8t8.us>
Wed, 23 Oct 2019 06:33:09 +0000 (14:33 +0800)
postpone.c

index 0ce25d30b8ab1e0d7a704387b02a6e9d3546afd4..edad66c4df446772f9aa5b72f0c92a2918a0152a 100644 (file)
@@ -113,15 +113,19 @@ int mutt_num_postponed (int force)
   {
     /* if we have a maildir mailbox, we need to stat the "new" dir */
 
-    char buf[_POSIX_PATH_MAX];
+    BUFFER *buf;
 
-    snprintf (buf, sizeof (buf), "%s/new", Postponed);
-    if (access (buf, F_OK) == 0 && stat (buf, &st) == -1)
+    buf = mutt_buffer_pool_get ();
+    mutt_buffer_printf (buf, "%s/new", 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)