From 0c23aed6001884618d985a01ff6e0e3c7bced574 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Wed, 23 Feb 2005 22:10:38 +0000 Subject: [PATCH] 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 --- src/winio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.39.5