- /*
- * if we have enough space for buffer, format lines to $COLS-$SidebarWidth
- * only to not wrap past end of screen
- */
- int width = COLS - SW;
- mutt_FormatString (buf, (width >= len ? len : (width + 1)),
- p, status_format_str,
- (unsigned long) menu, 0);
+ /*
+ * if we have enough space for buffer, format lines to $COLS-$SidebarWidth
+ * only to not wrap past end of screen
+ */
+ int width = MIN(COLS - SW + 1, len);
+ m_strformat(buf, width, p, status_format_str, menu, 0);