X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=status.c;h=f95eb326f16dbfc1d5ae6eabeb6890700288ccd5;hb=23002a877577341cfd68687e58348e0ca01b1ac5;hp=099157d1e93dab669f307bbadd361674d259b0a8;hpb=1f2995420ee1612199ab8af9909159a2a8afbdab;p=apps%2Fmadmutt.git diff --git a/status.c b/status.c index 099157d..f95eb32 100644 --- a/status.c +++ b/status.c @@ -11,6 +11,8 @@ # include "config.h" #endif +#include + #include "mutt.h" #include "mutt_menu.h" #include "mutt_curses.h" @@ -62,7 +64,8 @@ static const char *status_format_str (char *buf, size_t buflen, char op, const char *elsestring, unsigned long data, format_flag flags) { - char fmt[SHORT_STRING], tmp[SHORT_STRING], *cp, *p; + char fmt[SHORT_STRING], tmp[SHORT_STRING]; + const char *cp, *p; int count, optional = (flags & M_FORMAT_OPTIONAL); MUTTMENU *menu = (MUTTMENU *) data; @@ -316,6 +319,8 @@ void menu_status_line (char* buf, size_t len, MUTTMENU* menu, const char* p) { * if we have enough space for buffer, format lines to $COLS-$SidebarWidth * only to not wrap past end of screen */ - mutt_FormatString (buf, (COLS-SW)>len?len:(COLS-SW), p, status_format_str, + int width = COLS - SW; + mutt_FormatString (buf, (width >= len ? len : (width + 1)), + p, status_format_str, (unsigned long) menu, 0); }