w(1) uses strftime %b with to print the abbreviated month name
if a user logged in more than a week ago. This may contain multibyte characters (e.g. when using UTF-8). This string is then aligned on byte-length rathern than char-length, resulting in misalignment and unfinished multibyte characters. PR: 126657 Submitted by: Johan van Selst <johans@stack.nl>
This commit is contained in:
parent
040b1db930
commit
e39ee4216c
@ -44,6 +44,7 @@ static const char sccsid[] = "@(#)pr_time.c 8.2 (Berkeley) 4/4/94";
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include "extern.h"
|
||||
|
||||
@ -82,7 +83,7 @@ pr_attime(time_t *started, time_t *now)
|
||||
}
|
||||
|
||||
(void)strftime(buf, sizeof(buf), fmt, &tp);
|
||||
(void)printf("%-7.7s", buf);
|
||||
(void)wprintf(L"%-7.7s", buf);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user