From: David Lawrence Ramsey Date: Wed, 23 Feb 2005 22:10:38 +0000 (+0000) Subject: fix erroneous statusbar message truncation with multibyte strings X-Git-Tag: v1.3.6~77 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=0c23aed6001884618d985a01ff6e0e3c7bced574;p=nano.git fix erroneous statusbar message truncation with multibyte strings git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2326 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/src/winio.c b/src/winio.c index 131505de..e82abeaf 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2849,8 +2849,8 @@ void statusbar(const char *msg, ...) UNSET(WHITESPACE_DISPLAY); #endif - bar = charalloc(COLS - 3); - vsnprintf(bar, COLS - 3, msg, ap); + bar = charalloc(mb_cur_max() * (COLS - 3)); + vsnprintf(bar, mb_cur_max() * (COLS - 3), msg, ap); va_end(ap); foo = display_string(bar, 0, COLS - 4, FALSE); #if !defined(NANO_SMALL) && defined(ENABLE_NANORC)