diff options
author | ume <ume@FreeBSD.org> | 2009-06-18 16:40:00 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2009-06-18 16:40:00 +0000 |
commit | 1df38023872009fd9556c189e7da834c1d250b34 (patch) | |
tree | d2a24a1c5a4b7fd5d851854d144fc6bec016e170 /usr.bin | |
parent | d9764744f958cbd493d6f95903eb717b3c1eda37 (diff) | |
download | FreeBSD-src-1df38023872009fd9556c189e7da834c1d250b34.zip FreeBSD-src-1df38023872009fd9556c189e7da834c1d250b34.tar.gz |
Since the width is always 2, it is enough to put just one
trailing space is enough.
MFC after: 1 week
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ncal/ncal.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ncal/ncal.c b/usr.bin/ncal/ncal.c index bd61de5..a65a2fc 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); } } |