let m_strformat accept NULL formats.
[apps/madmutt.git] / compose.c
index 1b278f4..52907b6 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -113,10 +113,11 @@ static struct mapping_t ComposeNewsHelp[] = {
 
 
 static void snd_entry (char *b, ssize_t blen, MUTTMENU * menu, int num) {
-  int w=(COLS-SW)>blen?blen:COLS-SW;
-  m_strformat (b, w, NONULL (AttachFormat), mutt_attach_fmt,
-                     ((ATTACHPTR **)menu->data)[num],
-                     M_FORMAT_STAT_FILE | (option(OPTARROWCURSOR) ? M_FORMAT_ARROWCURSOR : 0));
+  int w = MIN(COLS-SW, blen);
+
+  m_strformat(b, w, AttachFormat, mutt_attach_fmt,
+              ((ATTACHPTR **)menu->data)[num],
+              M_FORMAT_STAT_FILE | (option(OPTARROWCURSOR) ? M_FORMAT_ARROWCURSOR : 0));
 }
 
 static void redraw_crypt_lines (HEADER * msg)
@@ -460,8 +461,8 @@ static const char *compose_format_str (char *buf, ssize_t buflen, char op,
 static void compose_status_line (char *buf, ssize_t buflen, MUTTMENU * menu,
                                  const char *p)
 {
-  int w=(COLS-SW)>buflen?buflen:(COLS-SW);
-  m_strformat(buf, w, p, compose_format_str, menu, 0);
+    int w = MIN(COLS - SW, buflen);
+    m_strformat(buf, w, p, compose_format_str, menu, 0);
 }
 
 /* return values: