diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 2008-08-20 12:32:19 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 2008-08-20 12:32:19 +0000 |
commit | e39ee4216c41bdbf93b5ccd7fad5970b330d1040 (patch) | |
tree | 7207cabada36ce835795e38711c2997c539eefcf /usr.bin | |
parent | 040b1db93008b111d6ea81370ca9b1b7d5cde384 (diff) | |
download | src-e39ee4216c41bdbf93b5ccd7fad5970b330d1040.tar.gz src-e39ee4216c41bdbf93b5ccd7fad5970b330d1040.zip |
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>
Notes
Notes:
svn path=/head/; revision=181922
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/w/pr_time.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c index 5ac060de4bcc..9fe0b11df8b2 100644 --- a/usr.bin/w/pr_time.c +++ b/usr.bin/w/pr_time.c @@ -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); } /* |