Description: padlen does not take into account the width of utf8 characters when creating the hardstatus output. Author: Kees Cook === modified file 'src/display.c' --- src/display.c 2010-05-11 02:52:51 +0000 +++ src/display.c 2011-01-14 17:00:21 +0000 @@ -2119,7 +2119,7 @@ } #ifdef UTF8 -static int +int strlen_onscreen(unsigned char *c, unsigned char *end) { int len = 0; @@ -2171,6 +2171,18 @@ } } #else +int +strlen_onscreen(unsigned char *c, unsigned char *end) +{ + int len = 0; + char *s = c; + while (*c && (!end || c < end)) + { + c++; len++; + } + return len; +} + static int PrePutWinMsg(s, start, max) char *s; === modified file 'src/extern.h' --- src/extern.h 2010-03-29 17:52:14 +0000 +++ src/extern.h 2011-01-14 17:01:25 +0000 @@ -315,6 +315,7 @@ extern void ResetIdle __P((void)); extern void KillBlanker __P((void)); extern void DisplaySleep1000 __P((int, int)); +extern int strlen_onscreen __P((char *, char *)); /* resize.c */ extern int ChangeWindowSize __P((struct win *, int, int, int)); === modified file 'src/screen.c' --- src/screen.c 2010-03-29 17:52:14 +0000 +++ src/screen.c 2011-01-14 17:04:57 +0000 @@ -2518,6 +2518,8 @@ int truncper = 0; int trunclong = 0; struct backtick *bt; + + padlen += strlen(str) - strlen_onscreen(str, NULL); if (winmsg_numrend >= 0) winmsg_numrend = 0;