Make the cols size equal to destlen*2, to ensure there won't be an
actual truncation due to columns being filled before the buffer is.
---
 compress.c  | 2 +-
 messageid.c | 2 +-
 pgpinvoke.c | 2 +-
 smime.c     | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/compress.c b/compress.c
index 2f66434b..7757d040 100644
--- a/compress.c
+++ b/compress.c
@@ -372,7 +372,7 @@ expand_command_str(CONTEXT *ctx, const char *cmd, char 
*buf, int buflen)
   if (!ctx || !cmd || !buf)
     return;
 
-  mutt_FormatString(buf, buflen, 0, buflen, cmd, cb_format_str, ctx, 0);
+  mutt_FormatString(buf, buflen, 0, buflen * 2, cmd, cb_format_str, ctx, 0);
 }
 
 /**
diff --git a/messageid.c b/messageid.c
index 4bb1d839..ef4c5034 100644
--- a/messageid.c
+++ b/messageid.c
@@ -168,7 +168,7 @@ char *mutt_gen_msgid(ENVELOPE *env)
     fmt = "<%z@%f>";
 
   buf = mutt_buffer_pool_get();
-  mutt_FormatString(buf->data, buf->dsize, 0, buf->dsize,
+  mutt_FormatString(buf->data, buf->dsize, 0, buf->dsize * 2,
                     fmt, id_format_str, &id_data, 0);
   mutt_buffer_fix_dptr(buf);
 
diff --git a/pgpinvoke.c b/pgpinvoke.c
index ee4137d7..f791b413 100644
--- a/pgpinvoke.c
+++ b/pgpinvoke.c
@@ -150,7 +150,7 @@ const char *_mutt_fmt_pgp_command(char *dest,
 
 void mutt_pgp_command(char *d, size_t dlen, struct pgp_command_context *cctx, 
const char *fmt)
 {
-  mutt_FormatString(d, dlen, 0, MuttIndexWindow->cols, NONULL(fmt), 
_mutt_fmt_pgp_command, cctx, 0);
+  mutt_FormatString(d, dlen, 0, dlen * 2, NONULL(fmt), _mutt_fmt_pgp_command, 
cctx, 0);
   muttdbg(2, "%s", d);
 }
 
diff --git a/smime.c b/smime.c
index 1b1d70fd..9b7283c1 100644
--- a/smime.c
+++ b/smime.c
@@ -321,7 +321,7 @@ static const char *_mutt_fmt_smime_command(char *dest,
 static void mutt_smime_command(char *d, size_t dlen,
                                struct smime_command_context *cctx, const char 
*fmt)
 {
-  mutt_FormatString(d, dlen, 0, MuttIndexWindow->cols, NONULL(fmt), 
_mutt_fmt_smime_command,
+  mutt_FormatString(d, dlen, 0, dlen * 2, NONULL(fmt), _mutt_fmt_smime_command,
                     cctx, 0);
   muttdbg(2, "%s", d);
 }
-- 
2.56.1

Reply via email to