summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2008-08-20 12:32:19 +0000
committerache <ache@FreeBSD.org>2008-08-20 12:32:19 +0000
commit0808a9f2912acc48a06979b99b84b0ed4b6e9a00 (patch)
tree7207cabada36ce835795e38711c2997c539eefcf /usr.bin
parentae0c3320a778be95cf8aea11d3b23fe0987b7340 (diff)
downloadFreeBSD-src-0808a9f2912acc48a06979b99b84b0ed4b6e9a00.zip
FreeBSD-src-0808a9f2912acc48a06979b99b84b0ed4b6e9a00.tar.gz
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>
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/w/pr_time.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c
index 5ac060d..9fe0b11 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);
}
/*
OpenPOWER on IntegriCloud