From 2d373eba2771b7865d21f309ebe7ec9d24630f04 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Sat, 6 Oct 2018 15:07:27 -0700 Subject: [PATCH] Convert imap_rename and pgp_invoke_list_keys to use buffer pool. --- imap/imap.c | 7 +++---- pgpinvoke.c | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/imap/imap.c b/imap/imap.c index ed70abf4..b8c4bd72 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -139,14 +139,13 @@ int imap_rename_mailbox (IMAP_DATA* idata, IMAP_MBOX* mx, const char* newname) imap_munge_mbox_name (idata, oldmbox, sizeof (oldmbox), mx->mbox); imap_munge_mbox_name (idata, newmbox, sizeof (newmbox), newname); - b = mutt_buffer_new (); - mutt_buffer_increase_size (b, LONG_STRING); + b = mutt_buffer_pool_get (); mutt_buffer_printf (b, "RENAME %s %s", oldmbox, newmbox); - if (imap_exec (idata, b->data, 0) != 0) + if (imap_exec (idata, mutt_b2s (b), 0) != 0) rc = -1; - mutt_buffer_free (&b); + mutt_buffer_pool_release (&b); return rc; } diff --git a/pgpinvoke.c b/pgpinvoke.c index 97182909..e7f1e97e 100644 --- a/pgpinvoke.c +++ b/pgpinvoke.c @@ -346,8 +346,7 @@ pid_t pgp_invoke_list_keys (FILE **pgpin, FILE **pgpout, FILE **pgperr, char quoted[HUGE_STRING]; pid_t rc; - uids = mutt_buffer_new (); - mutt_buffer_increase_size (uids, HUGE_STRING); + uids = mutt_buffer_pool_get (); for (; hints; hints = hints->next) { @@ -358,10 +357,10 @@ pid_t pgp_invoke_list_keys (FILE **pgpin, FILE **pgpout, FILE **pgperr, } rc = pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, - 0, NULL, NULL, uids->data, + 0, NULL, NULL, mutt_b2s (uids), keyring == PGP_SECRING ? PgpListSecringCommand : PgpListPubringCommand); - mutt_buffer_free (&uids); + mutt_buffer_pool_release (&uids); return rc; } -- 2.40.0