*dest = 0;
}
- if (optional)
- m_strformat (dest, destlen, ifstr, mutt_attach_fmt, data, 0);
- else if (flags & M_FORMAT_OPTIONAL)
- m_strformat (dest, destlen, elstr, mutt_attach_fmt, data, 0);
- return (src);
+ if (flags & M_FORMAT_OPTIONAL)
+ m_strformat(dest, destlen, optional ? ifstr : elstr,
+ mutt_attach_fmt, data, 0);
+ return src;
}
-static void attach_entry (char *b, ssize_t blen, MUTTMENU * menu, int num)
+static void attach_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],
- option(OPTARROWCURSOR) ? M_FORMAT_ARROWCURSOR : 0);
+ int w = MIN(COLS - SW, blen);
+
+ m_strformat(b, w, AttachFormat, mutt_attach_fmt,
+ ((ATTACHPTR **) menu->data)[num],
+ option(OPTARROWCURSOR) ? M_FORMAT_ARROWCURSOR : 0);
}
int mutt_tag_attach (MUTTMENU * menu, int n, int m)