Date: Thu, 18 Jun 2009 16:40:00 +0000 (UTC) From: Hajimu UMEMOTO <ume@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r194447 - head/usr.bin/ncal Message-ID: <200906181640.n5IGe0fa016952@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ume Date: Thu Jun 18 16:40:00 2009 New Revision: 194447 URL: http://svn.freebsd.org/changeset/base/194447 Log: Since the width is always 2, it is enough to put just one trailing space is enough. MFC after: 1 week Modified: head/usr.bin/ncal/ncal.c Modified: head/usr.bin/ncal/ncal.c ============================================================================== --- head/usr.bin/ncal/ncal.c Thu Jun 18 15:57:57 2009 (r194446) +++ head/usr.bin/ncal/ncal.c Thu Jun 18 16:40:00 2009 (r194447) @@ -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); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906181640.n5IGe0fa016952>