From 8f35cb98dbc2e07afa4296c0433670ee16e7222a Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Wed, 23 Oct 2019 14:33:09 +0800 Subject: [PATCH] Convert mutt_num_postponed() maildir check to use buffer pool Upstream-commit: https://gitlab.com/muttmua/mutt/commit/80bc61db364b4e031a9789ce8c79a5f083fc8652 Co-authored-by: Richard Russon --- postpone.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/postpone.c b/postpone.c index e1bda7a07..aac353487 100644 --- a/postpone.c +++ b/postpone.c @@ -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) -- 2.40.0