Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Apr 2009 14:54:36 -0400
From:      David Schultz <das@FreeBSD.ORG>
To:        Roman Divacky <rdivacky@FreeBSD.ORG>
Cc:        svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG
Subject:   Re: svn commit: r191330 - head/usr.bin/ncal
Message-ID:  <20090421185436.GA18628@zim.MIT.EDU>
In-Reply-To: <200904201819.n3KIJcZo054306@svn.freebsd.org>
References:  <200904201819.n3KIJcZo054306@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Apr 20, 2009, Roman Divacky wrote:
> Author: rdivacky
> Date: Mon Apr 20 18:19:38 2009
> New Revision: 191330
> URL: http://svn.freebsd.org/changeset/base/191330
> 
> Log:
>   Implement highlighting of today in month view of cal/ncal just like
>   gnu cal does. This is currently disabled for year view because of hard
>   coded padding in that case. This will hopefully be fixed soon.

As I recall, ncal relies on the length of each line it formats to
take care of alignment issues in various places. Are you sure that
adding control characters doesn't break that?

Also, before this change, ncal was already full of convoluted
buffer handling, arbitrary buffer sizes, and little to no bounds
checking. This commit adds more magic numbers and fragile buffer
handling code, and generally makes an already hairy program even
less scrutable. This isn't your fault, but it would be nice if we
could make ncal better before it gets much worse. For instance,
you might use snprintf() or asprintf() instead of an extra half
dozen calls to memcpy() with various offsets.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090421185436.GA18628>