aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/ncal
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2009-06-18 16:40:00 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2009-06-18 16:40:00 +0000
commit46f39347f56fd669e9a2133c5d8b486ed726b152 (patch)
treed2a24a1c5a4b7fd5d851854d144fc6bec016e170 /usr.bin/ncal
parentb94b189aa597336961098a3ad5864d705cdc1a03 (diff)
downloadsrc-46f39347f56fd669e9a2133c5d8b486ed726b152.tar.gz
src-46f39347f56fd669e9a2133c5d8b486ed726b152.zip
Since the width is always 2, it is enough to put just one
trailing space is enough. MFC after: 1 week
Notes
Notes: svn path=/head/; revision=194447
Diffstat (limited to 'usr.bin/ncal')
-rw-r--r--usr.bin/ncal/ncal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ncal/ncal.c b/usr.bin/ncal/ncal.c
index bd61de550f2a..a65a2fcf8a2d 100644
--- a/usr.bin/ncal/ncal.c
+++ b/usr.bin/ncal/ncal.c
@@ -844,7 +844,7 @@ mkweekdays(struct weekdays *wds)
for (i = 0; i != 7; i++) {
tm.tm_wday = (i+1) % 7;
wcsftime(buf, sizeof(buf), L"%a", &tm);
- for (len = wcslen(buf); len > 0; --len) {
+ for (len = 2; len > 0; --len) {
if ((width = wcswidth(buf, len)) <= 2)
break;
}
@@ -852,7 +852,7 @@ mkweekdays(struct weekdays *wds)
if (width == 1)
wds->names[i][0] = L' ';
wcsncat(wds->names[i], buf, len);
- wcsncat(wds->names[i], L" ", 3 - wcswidth(wds->names[i], 2));
+ wcsncat(wds->names[i], L" ", 1);
}
}