X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-ui%2Fstatus.c;h=3462ffa7e762c4089f97051c4720a71a64db28d8;hb=8a2967d883cee12f0de4c0cdf0cd594ea96e622b;hp=ffbdaeeaa53fbdc85aa849ab9dc617444d2c5c39;hpb=38dacbf03fe1a0daa9ce426caaef5582b90006b2;p=apps%2Fmadmutt.git diff --git a/lib-ui/status.c b/lib-ui/status.c index ffbdaee..3462ffa 100644 --- a/lib-ui/status.c +++ b/lib-ui/status.c @@ -275,7 +275,7 @@ static const char *status_format_str (char *buf, ssize_t buflen, char op, return (src); default: - snprintf (buf, buflen, "%%%s%c", prefix, op); + *buf = 0; break; } @@ -288,11 +288,10 @@ static const char *status_format_str (char *buf, ssize_t buflen, char op, } void menu_status_line (char* buf, ssize_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 - */ - int width = COLS - SW; - m_strformat(buf, (width >= len ? len : (width + 1)), p, status_format_str, - 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); }