rework m_strformat so that it takes the cols number to use in case of
[apps/madmutt.git] / recvattach.c
index 1c21de7..301b12e 100644 (file)
@@ -139,13 +139,10 @@ ATTACHPTR **mutt_gen_attach_list (BODY * m,
  * %s = size
  * %u = unlink 
  */
-const char *mutt_attach_fmt (char *dest, ssize_t destlen,
-                             char op,
-                             const char *src,
-                             const char *prefix,
-                             const char *ifstr,
-                             const char *elstr,
-                             anytype data, format_flag flags)
+const char *
+mutt_attach_fmt(char *dest, ssize_t destlen, char op, const char *src,
+                const char *prefix, const char *ifstr, const char *elstr,
+                anytype data, format_flag flags)
 {
   char fmt[16];
   char tmp[STRING];
@@ -312,16 +309,14 @@ const char *mutt_attach_fmt (char *dest, ssize_t destlen,
   }
 
   if (flags & M_FORMAT_OPTIONAL)
-    m_strformat(dest, destlen, optional ? ifstr : elstr,
+    m_strformat(dest, destlen, 0, optional ? ifstr : elstr,
                 mutt_attach_fmt, data, 0);
   return src;
 }
 
 static void attach_entry(char *b, ssize_t blen, MUTTMENU * menu, int num)
 {
-    int w = MIN(COLS - SW, blen);
-
-    m_strformat(b, w, AttachFormat, mutt_attach_fmt,
+    m_strformat(b, blen, COLS - SW, AttachFormat, mutt_attach_fmt,
                 ((ATTACHPTR **) menu->data)[num],
                 option(OPTARROWCURSOR) ? M_FORMAT_ARROWCURSOR : 0);
 }